Everytime I try to use pip to do something
pip install <package>
I get an error
OSError: [Errno 9] Bad file descriptor
I tried installing and reinstalling anaconda. I'm currently trying to create a virtualenv from pycharm and can't seem to do so because of this error. I need some new packages for a new project and need a way around this.
If anyone faced similar circumstances or want more debug information regarding my system please leave a comment down below, I'd be happy to help!
Here's a full stack trace for the error I'm getting while using 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
Can this be an issue with regarding python version? Currently using python 3.6.3 on Windows 10 and PyCharm 2017.3
{PythonInstallDir}\Lib\http\cookies.py
is available and accessible.