每次我尝试使用 pip 做某事时
pip install <package>
我收到错误
OSError:[Errno 9] 错误的文件描述符
我尝试安装并重新安装 anaconda。我目前正在尝试从 pycharm 创建一个虚拟环境,但由于这个错误,似乎无法做到这一点。我需要一些用于新项目的新包,需要解决这个问题。
如果有人遇到类似的情况或想要更多关于我的系统的调试信息,请在下面发表评论,我很乐意提供帮助!
这是我使用 pip 时遇到的错误的完整堆栈跟踪:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2017.3\helpers\packaging_tool.py", line 192, in main
retcode = do_install(pkgs)
File "C:\Program Files\JetBrains\PyCharm 2017.3\helpers\packaging_tool.py", line 106, in do_install
import pip
File "D:\venv1\lib\site-packages\pip-9.0.1-py3.6.egg\pip\__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "D:\venv1\lib\site-packages\pip-9.0.1-py3.6.egg\pip\_vendor\requests\__init__.py", line 65, in <module>
from . import utils
File "D:\venv1\lib\site-packages\pip-9.0.1-py3.6.egg\pip\_vendor\requests\utils.py", line 23, in <module>
from .compat import parse_http_list as _parse_list_header
File "D:\venv1\lib\site-packages\pip-9.0.1-py3.6.egg\pip\_vendor\requests\compat.py", line 60, in <module>
from http.cookies import Morsel
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 674, in exec_module
File "<frozen importlib._bootstrap_external>", line 780, in get_code
File "<frozen importlib._bootstrap_external>", line 833, in get_data
OSError: [Errno 9] Bad file descriptor
这可能是与 Python 版本有关的问题吗?目前在 Windows 10 和 PyCharm 2017.3 上使用 Python 3.6.3