question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When using Python 3.10 on Windows, pip install --user installs scripts to wrong dir

See original GitHub issue
  1. Git clone of ue4-docker
  2. Windows
  3. Python 3.10
  4. Run pip install -e . --user in ue4-docker repo root

Expected: ue4-docker.exe script is installed in C:\Users\<user>\AppData\Roaming\Python\Python310\Scripts.

Actual: ue4-docker.exe script is installed in C:\Users\<user>\AppData\Roaming\Python\Python31\Scripts.

Python310 != Python31.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
TBBlecommented, Mar 26, 2022

Ah! I think I got it: https://github.com/pypa/setuptools/issues/3001. Looks like setuptools v60.4.0 fixed it via https://github.com/pypa/setuptools/pull/2953. Although again, this bug should also have affected the site-pacakges, not just the scripts.

But I’d definitely suggest upgrading setuptools and see if that fixes it.


Yeah, definitely this. From what I traced before, {py_version_nodot} is the name being used in the path in that version (later replaced with {py_version_nodot_plat} seen above), and it was previously defined as

py_version = sys.version.split()[0]
py_version_nodot= py_version[0] + py_version[2]

i.e.

>>> sys.version.split()[0][0] + sys.version.split()[0][2]
'31'

and is now

>>> f'{sys.version_info.major}{sys.version_info.minor}'
'310'

And before the above fix, this calculation hadn’t been touched since 2013.

0reactions
TBBlecommented, Mar 26, 2022

I was on Python 3.10.2. I’ve just upgraded, and will try again. I’d suggest upgrading setuptools as well, perhaps.

The other thing I’d suggest is maybe try the Python installer directly, without Chocolatey? I had a quick look and nothing in the install scripts jumped out at me as “This will affect the user base dir”, but I’m running out of differences.

I just tried again after upgrading to Python 3.10.4, and it still works for me.

From the log:

> py -3.10 -m pip --verbose install --user --editable .
...
  Running setup.py develop for ue4-docker
    Running command python setup.py develop
    running develop
    C:\Users\paulh\AppData\Roaming\Python\Python310\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    C:\Users\paulh\AppData\Roaming\Python\Python310\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running egg_info
    creating ue4_docker.egg-info
    writing ue4_docker.egg-info\PKG-INFO
    writing dependency_links to ue4_docker.egg-info\dependency_links.txt
    writing entry points to ue4_docker.egg-info\entry_points.txt
    writing requirements to ue4_docker.egg-info\requires.txt
    writing top-level names to ue4_docker.egg-info\top_level.txt
    writing manifest file 'ue4_docker.egg-info\SOURCES.txt'
    reading manifest file 'ue4_docker.egg-info\SOURCES.txt'
    adding license file 'LICENSE'
    writing manifest file 'ue4_docker.egg-info\SOURCES.txt'
    running build_ext
    Creating c:\users\paulh\appdata\roaming\python\python310\site-packages\ue4-docker.egg-link (link to .)
    Adding ue4-docker 0.0.96 to easy-install.pth file
    Installing ue4-docker-script.py script to C:\Users\paulh\AppData\Roaming\Python/Python310/Scripts
    Installing ue4-docker.exe script to C:\Users\paulh\AppData\Roaming\Python/Python310/Scripts

    Installed c:\users\paulh\ue4\ue4-docker
Successfully installed Jinja2-3.1.1 MarkupSafe-2.1.1 Pygments-2.11.2 Werkzeug-2.0.3 bleach-4.1.0 certifi-2021.10.8 charset-normalizer-2.0.12 container-utils-0.0.1 docker-4.2.2 docutils-0.18.1 flask-2.0.3 humanfriendly-10.0 idna-3.3 importlib-metadata-4.11.3 itsdangerous-2.1.2 keyring-23.5.0 pkginfo-1.8.2 psutil-5.9.0 pypiwin32-223 pyreadline3-3.4.1 pywin32-303 pywin32-ctypes-0.2.0 readme-renderer-34.0 requests-2.27.1 requests-toolbelt-0.9.1 rfc3986-2.0.0 semver-2.13.0 termcolor-1.1.0 tqdm-4.63.1 twine-3.8.0 ue4-docker-0.0.96 urllib3-1.26.9 webencodings-0.5.1 websocket-client-1.3.1 zipp-3.7.0

So it’s clearly handing off to setuptools for the relevant step. You might find you can run setup.py develop directly and see what it does.

Full log
> py -3.10 -m pip --verbose install --user --editable .
Using pip 22.0.4 from C:\Users\paulh\AppData\Roaming\Python\Python310\site-packages\pip (python 3.10)
Obtaining file:///C:/Users/paulh/ue4/ue4-docker
  Running command python setup.py egg_info
  running egg_info
  creating C:\Users\paulh\AppData\Local\Temp\pip-pip-egg-info-gva9hupx\ue4_docker.egg-info
  writing C:\Users\paulh\AppData\Local\Temp\pip-pip-egg-info-gva9hupx\ue4_docker.egg-info\PKG-INFO
  writing dependency_links to C:\Users\paulh\AppData\Local\Temp\pip-pip-egg-info-gva9hupx\ue4_docker.egg-info\dependency_links.txt
  writing entry points to C:\Users\paulh\AppData\Local\Temp\pip-pip-egg-info-gva9hupx\ue4_docker.egg-info\entry_points.txt
  writing requirements to C:\Users\paulh\AppData\Local\Temp\pip-pip-egg-info-gva9hupx\ue4_docker.egg-info\requires.txt
  writing top-level names to C:\Users\paulh\AppData\Local\Temp\pip-pip-egg-info-gva9hupx\ue4_docker.egg-info\top_level.txt
  writing manifest file 'C:\Users\paulh\AppData\Local\Temp\pip-pip-egg-info-gva9hupx\ue4_docker.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\paulh\AppData\Local\Temp\pip-pip-egg-info-gva9hupx\ue4_docker.egg-info\SOURCES.txt'
  adding license file 'LICENSE'
  writing manifest file 'C:\Users\paulh\AppData\Local\Temp\pip-pip-egg-info-gva9hupx\ue4_docker.egg-info\SOURCES.txt'
  Preparing metadata (setup.py) ... done
Requirement already satisfied: colorama in c:\users\paulh\appdata\roaming\python\python310\site-packages (from ue4-docker==0.0.96) (0.4.4)
Collecting container-utils
  Using cached container_utils-0.0.1-py3-none-any.whl (6.4 kB)
Collecting docker>=3.0.0
  Using cached docker-5.0.3-py2.py3-none-any.whl (146 kB)
Collecting flask
  Using cached Flask-2.0.3-py3-none-any.whl (95 kB)
Collecting humanfriendly
  Using cached humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
Collecting Jinja2>=2.11.3
  Using cached Jinja2-3.1.1-py3-none-any.whl (132 kB)
Requirement already satisfied: packaging>=19.1 in c:\users\paulh\appdata\roaming\python\python310\site-packages (from ue4-docker==0.0.96) (21.3)
Collecting psutil
  Using cached psutil-5.9.0-cp310-cp310-win_amd64.whl (245 kB)
Collecting requests
  Using cached requests-2.27.1-py2.py3-none-any.whl (63 kB)
Collecting semver<3.0.0,>=2.7.9
  Using cached semver-2.13.0-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: setuptools>=38.6.0 in c:\users\paulh\appdata\roaming\python\python310\site-packages (from ue4-docker==0.0.96) (61.1.0)
Collecting termcolor
  Using cached termcolor-1.1.0-py3-none-any.whl
Collecting twine>=1.11.0
  Using cached twine-3.8.0-py3-none-any.whl (36 kB)
Requirement already satisfied: wheel>=0.31.0 in c:\users\paulh\appdata\roaming\python\python310\site-packages (from ue4-docker==0.0.96) (0.37.1)
Collecting websocket-client>=0.32.0
  Using cached websocket_client-1.3.1-py3-none-any.whl (54 kB)
Collecting docker>=3.0.0
  Using cached docker-5.0.2-py2.py3-none-any.whl (145 kB)
  Using cached docker-5.0.1-py2.py3-none-any.whl (145 kB)
  Using cached docker-5.0.0-py2.py3-none-any.whl (146 kB)
  Using cached docker-4.4.4-py2.py3-none-any.whl (147 kB)
  Using cached docker-4.4.3-py2.py3-none-any.whl (146 kB)
  Using cached docker-4.4.2-py2.py3-none-any.whl (146 kB)
  Using cached docker-4.4.1-py2.py3-none-any.whl (146 kB)
  Using cached docker-4.4.0-py2.py3-none-any.whl (146 kB)
  Using cached docker-4.3.1-py2.py3-none-any.whl (145 kB)
  Using cached docker-4.3.0-py2.py3-none-any.whl (145 kB)
  Using cached docker-4.2.2-py2.py3-none-any.whl (144 kB)
Collecting pypiwin32==223
  Using cached pypiwin32-223-py3-none-any.whl (1.7 kB)
Requirement already satisfied: six>=1.4.0 in c:\users\paulh\appdata\roaming\python\python310\site-packages (from docker>=3.0.0->ue4-docker==0.0.96) (1.16.0)
Collecting pywin32>=223
  Using cached pywin32-303-cp310-cp310-win_amd64.whl (9.2 MB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-2.1.1-cp310-cp310-win_amd64.whl (17 kB)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\paulh\appdata\roaming\python\python310\site-packages (from packaging>=19.1->ue4-docker==0.0.96) (3.0.7)
Collecting certifi>=2017.4.17
  Using cached certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.3-py3-none-any.whl (61 kB)
Collecting charset-normalizer~=2.0.0
  Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.9-py2.py3-none-any.whl (138 kB)
Collecting readme-renderer>=21.0
  Using cached readme_renderer-34.0-py3-none-any.whl (16 kB)
Collecting importlib-metadata>=3.6
  Using cached importlib_metadata-4.11.3-py3-none-any.whl (18 kB)
Collecting tqdm>=4.14
  Using cached tqdm-4.63.1-py2.py3-none-any.whl (76 kB)
Collecting rfc3986>=1.4.0
  Using cached rfc3986-2.0.0-py2.py3-none-any.whl (31 kB)
Collecting requests-toolbelt!=0.9.0,>=0.8.0
  Using cached requests_toolbelt-0.9.1-py2.py3-none-any.whl (54 kB)
Collecting pkginfo>=1.8.1
  Using cached pkginfo-1.8.2-py2.py3-none-any.whl (26 kB)
Collecting keyring>=15.1
  Using cached keyring-23.5.0-py3-none-any.whl (33 kB)
Collecting Werkzeug>=2.0
  Using cached Werkzeug-2.0.3-py3-none-any.whl (289 kB)
Collecting itsdangerous>=2.0
  Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Requirement already satisfied: click>=7.1.2 in c:\users\paulh\appdata\roaming\python\python310\site-packages (from flask->ue4-docker==0.0.96) (8.0.4)
Collecting pyreadline3
  Using cached pyreadline3-3.4.1-py3-none-any.whl (95 kB)
Collecting zipp>=0.5
  Using cached zipp-3.7.0-py3-none-any.whl (5.3 kB)
Collecting pywin32-ctypes!=0.1.0,!=0.1.1
  Using cached pywin32_ctypes-0.2.0-py2.py3-none-any.whl (28 kB)
Collecting Pygments>=2.5.1
  Using cached Pygments-2.11.2-py3-none-any.whl (1.1 MB)
Collecting docutils>=0.13.1
  Using cached docutils-0.18.1-py2.py3-none-any.whl (570 kB)
Collecting bleach>=2.1.0
  Using cached bleach-4.1.0-py2.py3-none-any.whl (157 kB)
Collecting webencodings
  Using cached webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Installing collected packages: webencodings, termcolor, pywin32-ctypes, pywin32, pyreadline3, pkginfo, certifi, zipp, Werkzeug, websocket-client, urllib3, tqdm, semver, rfc3986, pypiwin32, Pygments, psutil, MarkupSafe, itsdangerous, idna, humanfriendly, docutils, charset-normalizer, requests, Jinja2, importlib-metadata, bleach, requests-toolbelt, readme-renderer, keyring, flask, docker, twine, container-utils, ue4-docker
  Running setup.py develop for ue4-docker
    Running command python setup.py develop
    running develop
    C:\Users\paulh\AppData\Roaming\Python\Python310\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    C:\Users\paulh\AppData\Roaming\Python\Python310\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running egg_info
    creating ue4_docker.egg-info
    writing ue4_docker.egg-info\PKG-INFO
    writing dependency_links to ue4_docker.egg-info\dependency_links.txt
    writing entry points to ue4_docker.egg-info\entry_points.txt
    writing requirements to ue4_docker.egg-info\requires.txt
    writing top-level names to ue4_docker.egg-info\top_level.txt
    writing manifest file 'ue4_docker.egg-info\SOURCES.txt'
    reading manifest file 'ue4_docker.egg-info\SOURCES.txt'
    adding license file 'LICENSE'
    writing manifest file 'ue4_docker.egg-info\SOURCES.txt'
    running build_ext
    Creating c:\users\paulh\appdata\roaming\python\python310\site-packages\ue4-docker.egg-link (link to .)
    Adding ue4-docker 0.0.96 to easy-install.pth file
    Installing ue4-docker-script.py script to C:\Users\paulh\AppData\Roaming\Python/Python310/Scripts
    Installing ue4-docker.exe script to C:\Users\paulh\AppData\Roaming\Python/Python310/Scripts

    Installed c:\users\paulh\ue4\ue4-docker
Successfully installed Jinja2-3.1.1 MarkupSafe-2.1.1 Pygments-2.11.2 Werkzeug-2.0.3 bleach-4.1.0 certifi-2021.10.8 charset-normalizer-2.0.12 container-utils-0.0.1 docker-4.2.2 docutils-0.18.1 flask-2.0.3 humanfriendly-10.0 idna-3.3 importlib-metadata-4.11.3 itsdangerous-2.1.2 keyring-23.5.0 pkginfo-1.8.2 psutil-5.9.0 pypiwin32-223 pyreadline3-3.4.1 pywin32-303 pywin32-ctypes-0.2.0 readme-renderer-34.0 requests-2.27.1 requests-toolbelt-0.9.1 rfc3986-2.0.0 semver-2.13.0 termcolor-1.1.0 tqdm-4.63.1 twine-3.8.0 ue4-docker-0.0.96 urllib3-1.26.9 webencodings-0.5.1 websocket-client-1.3.1 zipp-3.7.0
Read more comments on GitHub >

github_iconTop Results From Across the Web

pip giving error when trying to install packages Python 3.10
This error shows up on windows when one tries to use pip in the command prompt. To solve this error on windows, you...
Read more >
Pip installing off PATH: should I do something? - Python Help
WARNING: The script tabulate.exe is installed in 'C:\Users\atomi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\ ...
Read more >
python >= 3.10 script directory (pip bin dir) should be minor ...
When installing python libraries with pip , they end up in /usr/local/lib/python3.10/site-packages/ (for example), so a directory that is stable ...
Read more >
How to Install Pip on Windows - ActiveState
Open up the Control Panel and navigate to System and Security -> System; Click on the Advanced system settings link on the left...
Read more >
Pip Command Not Found on Windows: A Guide | Built In
A “pip: command not found” error occurs when you haven't properly installed the package installer for Python (pip) on your computer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found