Anoaconda安装多个python环境踩坑记录问题(含OSError: [WinError 126] 找不到指定的模块。)

it2023-11-12  72

目录

 

1.anaconda安装多个python环境:

2.添加错误的镜像之后删除

3.python-anaconda添加中科大镜像加速

4.在anaconda中新安装的环境没有Jupyter Notebook怎么办?

5.装某个包的时候遇到报错,写着要手动删除文件的。

6.即使是把扩展包下载下来了,本地安装的时候仍然是需要下载的。

7.装geopanads的时候,卡在Fiona这个包上面了。


扩展包神站:https://www.lfd.uci.edu/~gohlke/pythonlibs/

镜像源太慢的问题,直接用百度的镜像源:https://mirror.baidu.com/pypi/simple

1.anaconda安装多个python环境:

https://dalewushuang.blog.csdn.net/article/details/82982937?utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-3.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-3.channel_param https://blog.csdn.net/my_kingdom/article/details/68957736?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param

2.添加错误的镜像之后删除

搞成默认的(http://www.mamicode.com/info-detail-2698115.html) conda config --remove-key channels

3.python-anaconda添加中科大镜像加速

conda config –add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/ conda config –set show_channel_urls yes

4.在anaconda中新安装的环境没有Jupyter Notebook怎么办?

在客户端,点到environment,点到新安装的环境。 会出现绿色的播放号,点一下,然后open terminal,然后进入cmd框。 输入 conda install Jupyter Notebook 既可以开始安装

上官网去安装也行:https://jupyter.org/install

conda install -c conda-forge notebook

如果这里被某个包卡住了,自动跳出。

要手动把整个包删掉,重启电脑。

再安装一次,就行了,已经下载的会保存的。

下载太tm慢了,先把下面的包下载了:

pywin32-228-cp36-cp36m-win_amd64.whl

PyQt4-4.11.4-cp36-cp36m-win_amd64.whl

notebook-6.1.4-py3-none-any.whl

顺序安装。

pip install notebook-6.1.4-py3-none-any.whl -i  https://pypi.tuna.tsinghua.edu.cn/simple/

然后10min以内就能装完了

https://blog.csdn.net/tong_he/article/details/78813494?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control

然后在此环境中 打出 jupyter notebook 就可以启动了

5.装某个包的时候遇到报错,写着要手动删除文件的。

复制那个路径,然后进去把整个包都删除就行。

 

6.即使是把扩展包下载下来了,本地安装的时候仍然是需要下载的,速度过慢也会报错。

本地安装记得先cd到包所在的文件夹

速度太慢有时候会报错: 如raise ReadTimeoutError(self._pool, None, 'Read timed out.') pip._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

带上镜像地址进行本地安装就好

pip install tensorflow-1.9.0-cp36-cp36m-win_amd64.whl -i   https://pypi.tuna.tsinghua.edu.cn/simple/

常用镜像源:

阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/ 豆瓣http://pypi.doubanio.com/simple/ 清华大学https://pypi.tuna.tsinghua.edu.cn/simple/

 

7.装geopanads的时候,卡在Fiona这个包上面了。

如图:

先装GDAL,再安装Fiona。

一定要上网下载GDAL和Fiona这个包,下载下来再安装,先装GDAO再装Fiona,就可以了。

还会遇到错误:Command "python setup.py egg_info" failed with error code 1 in C:\Users\henry\AppData\Local\Temp\pip-build-a47hjka0\fiona\

fiona这个包遇到错误了,说什么GDAL啥的。上去下一个GDAL扩展包下来装就行。

8.OSError: [WinError 126] 找不到指定的模块。

安装dll

https://blog.csdn.net/m0_38124502/article/details/105582316

9.AttributeError: type object 'IOLoop' has no attribute 'initialized'

conda install tornado=4.5

10.OSError: [WinError 126] 找不到指定的模块。

首先报错,找了很多什么dll之类的,不行,然后看到这个链接:https://www.pianshen.com/article/90841683243/

但是依然没用,因此我在想是不是我复制错地方了。然后我回去看报错。

报错:

OSError Traceback (most recent call last) <ipython-input-1-2c57d8e64471> in <module> 3 get_ipython().run_line_magic('matplotlib', 'inline') 4 import os ----> 5 import geopandas as gpd 6 import pandas as pd 7 import numpy as np D:\Anaconda3\envs\tf_py36\lib\site-packages\geopandas\__init__.py in <module> 1 from geopandas._config import options # noqa 2 ----> 3 from geopandas.geoseries import GeoSeries # noqa 4 from geopandas.geodataframe import GeoDataFrame # noqa 5 from geopandas.array import points_from_xy # noqa D:\Anaconda3\envs\tf_py36\lib\site-packages\geopandas\geoseries.py in <module> 8 9 from pyproj import CRS, Transformer ---> 10 from shapely.geometry.base import BaseGeometry 11 12 from geopandas.base import GeoPandasBase, _delegate_property D:\Anaconda3\envs\tf_py36\lib\site-packages\shapely\geometry\__init__.py in <module> 2 """ 3 ----> 4 from .base import CAP_STYLE, JOIN_STYLE 5 from .geo import box, shape, asShape, mapping 6 from .point import Point, asPoint D:\Anaconda3\envs\tf_py36\lib\site-packages\shapely\geometry\base.py in <module> 17 18 from shapely.affinity import affine_transform ---> 19 from shapely.coords import CoordinateSequence 20 from shapely.errors import WKBReadingError, WKTReadingError 21 from shapely.geos import WKBWriter, WKTWriter D:\Anaconda3\envs\tf_py36\lib\site-packages\shapely\coords.py in <module> 6 from ctypes import byref, c_double, c_uint 7 ----> 8 from shapely.geos import lgeos 9 from shapely.topology import Validating 10 D:\Anaconda3\envs\tf_py36\lib\site-packages\shapely\geos.py in <module> 152 if os.getenv('CONDA_PREFIX', ''): 153 # conda package. --> 154 _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll')) 155 else: 156 try: D:\Anaconda3\envs\tf_py36\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error) 346 347 if handle is None: --> 348 self._handle = _dlopen(self._name, mode) 349 else: 350 self._handle = handle OSError: [WinError 126] 找不到指定的模块。

看到这个:

D:\Anaconda3\envs\tf_py36\lib\site-packages\shapely\geos.py in <module>

152 if os.getenv('CONDA_PREFIX', ''): 153 # conda package.

--> 154 _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll')) 

我懂了,不是随便复制的,是要复制到:D:\Anaconda3\envs\tf_py36\Library\bin

就是说,你要是装了虚拟环境,要到那个envs里面,找到你那个虚拟环境的Library\bin,复制到里面就行了

 

12.channels 404解决方案

https://blog.csdn.net/qq_42859864/article/details/90340164#comments

 

13. 使用jupyter的时候 说找不到libzmq。

最大的可能是你那个源的zmq包不行。换个源就解决了。

 

14.清理缓存

pip的:用 pip install xxx 安装库时,pip 把库缓存在了:C:\Users\Administrator\AppData\Local\pip\cache

conda的: conda clean -y --all

pip 可以在安装时使用-–no-cache-dir参数

15.enum问题

直接安装前 pip uninstall enum34

最新回复(0)