对于Windows,仅对于Ubuntu,MAc等,我发现了0个关于此问题的主题。
当我尝试通过Pycharm安装任何软件包时,例如urllib,matplotlib,heidi,我得到如下完全相同的错误消息。
项目解释器是Anaconda Python 3.7。
知道如何解决吗?
Error: Traceback (most recent call last):
File "E:\Download\PROGIK\Charm Community Edition 2018.3.5\helpers\packaging_tool.py", line 73, in run_pip
runpy.run_module(module_name, run_name='__main__', alter_sys=True)
File "E:\Download\PROGIK\Anaconda\lib\runpy.py", line 201, in run_module
mod_name, mod_spec, code = _get_module_details(mod_name)
File "E:\Download\PROGIK\Anaconda\lib\runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "E:\Download\PROGIK\Anaconda\lib\runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\__init__.py", line 15, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\vcs\subversion.py", line 9, in <module>
from pip.index import Link
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\index.py", line 30, in <module>
from pip.wheel import Wheel, wheel_ext
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\wheel.py", line 35, in <module>
from pip._vendor.distlib.scripts import ScriptMaker
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\_vendor\distlib\scripts.py", line 14, in <module>
from .compat import sysconfig, detect_encoding, ZipFile
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\_vendor\distlib\compat.py", line 66, in <module>
from urllib.request import (urlopen, urlretrieve, Request, url2pathname,
ImportError: cannot import name 'HTTPSHandler' from 'urllib.request' (E:\Download\PROGIK\Anaconda\lib\urllib\request.py)
编辑:使用pip我只有matplotlib有问题,这是另一个主题:
Cannot install matplotlib. Fatal error LNK1181, Visual Studio fail
只需进入packages文件夹并手动删除matplotlib软件包即可,因为无法使其在Jupyter中显示图形(请在Pycharm中尝试)。现在尝试重新安装它,希望它可以解决此问题。
答案 0 :(得分:0)
要在Windows10下的anaconda环境中安装软件包,应使用“ Anaconda提示符”(在win菜单中找到) 它默认启动(Base)venv并在其中安装软件包。因此,使用与Anaconda一起分发的Python解释器,您将能够在没有任何副作用的情况下导入它们。
除了默认情况下,matplotlib还安装在其中