Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown command or script: "pip" #27

Open
Openuser87 opened this issue Jul 15, 2024 · 6 comments
Open

Unknown command or script: "pip" #27

Openuser87 opened this issue Jul 15, 2024 · 6 comments
Labels
question Further information is requested

Comments

@Openuser87
Copy link

Trying to set up wenv on Fedora 39, wine 9.1.

Installation seems to run well:

$ WENV_PYTHONVERSION=3.12.4 wenv init
wine: configuration in L"/home/<user>/.local/share/wenv/win32" has been updated.
Collecting pip
  Downloading pip-24.1.2-py3-none-any.whl.metadata (3.6 kB)
Collecting setuptools
  Downloading setuptools-70.3.0-py3-none-any.whl.metadata (5.8 kB)
Collecting wheel
  Downloading wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
Downloading pip-24.1.2-py3-none-any.whl (1.8 MB)
   ---------------------------------------- 1.8/1.8 MB 3.8 MB/s eta 0:00:00
Downloading setuptools-70.3.0-py3-none-any.whl (931 kB)
   ---------------------------------------- 931.1/931.1 kB 7.0 MB/s eta 0:00:00
Downloading wheel-0.43.0-py3-none-any.whl (65 kB)
   ---------------------------------------- 65.8/65.8 kB 11.1 MB/s eta 0:00:00
Installing collected packages: wheel, setuptools, pip
Successfully installed pip-24.1.2 setuptools-70.3.0 wheel-0.43.0

But trying to execute a pip command yields:

wenv pip list
Unknown command or script: "pip"

How could this be fixed?

@Openuser87
Copy link
Author

Seems that happens with any version, except for default version 3.7. Also python command itself is not found:

wenv python --version
Unknown command or script: "python"

With default version, wenv init shows an error:

ERROR: This script does not work on Python 3.7. The minimum supported Python version is 3.8. Please use https://bootstrap.pypa.io/pip/3.7/get-pip.py instead.

Nevertheless, after that, python command seems to work:

wenv python --version
Python 3.7.4

But pip does not:

wenv pip list
Unknown command or script: "pip"

@s-m-e
Copy link
Member

s-m-e commented Jul 16, 2024

If you're setting an option via an environment variable the way you do it, every subsequent command must be prefixed with mentioned environment variable, e.g. WENV_PYTHONVERSION=3.12.4 wenv pip install foo. Alternatively, you can of cause alter this option also via configuration files etc.

@s-m-e s-m-e added the question Further information is requested label Jul 16, 2024
@Openuser87
Copy link
Author

Thank you, that works!

Ways to persist:

  • exporting environment variable (e.g. something like export WENV_PYTHONVERSION=3.12.4)
  • config (see example here), e.g. put the following into .wenv.json in the directory where you execute wenv:
    {
      "pythonversion": "3.12.4"
    }
    

Could this possibly be emphasized a little more in the official documentation?

@s-m-e
Copy link
Member

s-m-e commented Jul 18, 2024

Sure, this can be done.

@musteresel
Copy link

Ran into this as well; only in my case the default wenv init came up with the error message (without any ENV variables set):

[musteresel@ideapad:/tmp/wenv]$ nix-shell -p python3 wine

[nix-shell:/tmp/wenv]$ python --version
Python 3.12.4

[nix-shell:/tmp/wenv]$ wine --version 
wine-9.0

[nix-shell:/tmp/wenv]$ uname -a
Linux ideapad 6.10.0 #1-NixOS SMP PREEMPT_DYNAMIC Sun Jul 14 22:43:32 UTC 2024 x86_64 GNU/Linux

[nix-shell:/tmp/wenv]$ python -m venv .

[nix-shell:/tmp/wenv]$ . bin/activate
(wenv) 
[nix-shell:/tmp/wenv]$ pip install wenv
Collecting wenv
  Using cached wenv-0.5.1-py3-none-any.whl.metadata (8.0 kB)
Using cached wenv-0.5.1-py3-none-any.whl (33 kB)
Installing collected packages: wenv
Successfully installed wenv-0.5.1

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip
(wenv) 
[nix-shell:/tmp/wenv]$ wenv init
wine: configuration in L"/tmp/wenv/share/wenv/win32" has been updated.
ERROR: This script does not work on Python 3.7. The minimum supported Python version is 3.8. Please use https://bootstrap.pypa.io/pip/3.7/get-pip.py instead.
(wenv) 
[nix-shell:/tmp/wenv]$ echo '{"pythonversion":"3.8.0"}' > .wenv.json
(wenv) 
[nix-shell:/tmp/wenv]$ wenv init
Collecting pip
  Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Collecting setuptools
  Downloading setuptools-75.2.0-py3-none-any.whl.metadata (6.9 kB)
Collecting wheel
  Downloading wheel-0.44.0-py3-none-any.whl.metadata (2.3 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
   ---------------------------------------- 1.8/1.8 MB 6.2 MB/s eta 0:00:00
Downloading setuptools-75.2.0-py3-none-any.whl (1.2 MB)
   ---------------------------------------- 1.2/1.2 MB 5.5 MB/s eta 0:00:00
Downloading wheel-0.44.0-py3-none-any.whl (67 kB)
Installing collected packages: wheel, setuptools, pip
Successfully installed pip-24.2 setuptools-75.2.0 wheel-0.44.0
(wenv) 
[nix-shell:/tmp/wenv]$ wenv pip --version
pip 24.2 from C:\python-3.8.0.stable\lib\site-packages\pip (python 3.8)
(wenv) 
[nix-shell:/tmp/wenv]$ 

By default this seems to pull Python 3.7.0 which seems to no longer be supported (by pip?)

@s-m-e
Copy link
Member

s-m-e commented Oct 21, 2024

By default this seems to pull Python 3.7.0 which seems to no longer be supported (by pip?)

Affirmative. The default Python version for Python on Wine is outdated. Try 3.8 (e.g. 3.8.10) or younger instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants