Thomas Knox
Thomas Knox

Reputation: 21

EnvironmentError when pip installing ipython

I keep getting this error when trying to pip install ipython on my Windows. pip worked for pandas and other libs.

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\Me\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\jedi\\third_party\\typeshed\\third_party\\2and3\\requests\\packages\\urllib3\\packages\\ssl_match_hostname\\_implementation.pyi'
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\commands\install.py", line 407, in run
    use_user_site=options.use_user_site,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\req\__init__.py", line 58, in install_given_reqs
    **kwargs
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\req\req_install.py", line 928, in install
    use_user_site=use_user_site, pycompile=pycompile,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\req\req_install.py", line 461, in move_wheel_files
    warn_script_location=warn_script_location,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\wheel.py", line 432, in move_wheel_files
    clobber(source, lib_dir, True)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\wheel.py", line 410, in clobber
    shutil.copyfile(srcfile, destfile)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\My User\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\jedi\\third_party\\typeshed\\third_party\\2and3\\requests\\packages\\urllib3\\packages\\ssl_match_hostname\\_implementation.pyi'```

Upvotes: 2

Views: 4367

Answers (3)

Piotr
Piotr

Reputation: 61

I had similar issue. I changed the registry key "Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled" to 1.

Upvotes: 6

Tim LaCrosse
Tim LaCrosse

Reputation: 11

The Windows Python installer allows you to change the maximum path length at install or upgrade and this will fix the problem. You can also lookup change maximum path length Win 10 to find out how to change the registry.

Upvotes: 0

L3n95
L3n95

Reputation: 1615

I had the same problem. For me it was, that the file path was too long. Rename things (for example the PythonSoftwareFoundation.Python.3.7_3.7.1473.0_x64__qbz5n2kfra8p0 stuff) to shorten the path.

Upvotes: 1

Related Questions