python -m pip --2.7.18 ✔
Usage:
/usr/bin/python -m pip <command> [options]
no such option: --2.7.18
~ python -m pip --version 2 ✘
pip 24.0 from /usr/lib/python3.12/site-packages/pip (python 3.12)
~ python -m pip install ipykernel ✔
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
python-xyz', where xyz is the package you are trying to
install.
If you wish to install a non-Arch-packaged Python package,
create a virtual environment using 'python -m venv path/to/venv'.
Then use path/to/venv/bin/python and path/to/venv/bin/pip.
If you wish to install a non-Arch packaged Python application,
it may be easiest to use 'pipx install xyz', which will manage a
virtual environment for you. Make sure you have python-pipx
installed via pacman.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
~ python2 -m pip install ipykernel 1 ✘
python2 -m ipykernel install --user
zsh: correct 'python2' to 'python3' [nyae]? n
zsh: correct 'python2' to 'python3' [nyae]? n
zsh: command not found: python2
zsh: command not found: python2
~ python2 -m pip --version 127 ✘
zsh: correct 'python2' to 'python3' [nyae]? n
zsh: command not found: python2
~ 127 ✘
~ 127 ✘
Please help me as i have to use python 2.7 for running old code.
~ sudo pacman -S python2 1 ✘
[sudo] password for raman:
error: target not found: python2
warning: 'python2' is a file, did you mean -U/--upgrade instead of -S/--sync?
~ python2 -m pip --version 1 ✘ 3s
zsh: command not found: python2
~
Sorry, we can’t do this for you. The link with the gives full instructions for managing multiple python versions using pyenv - you just need to read and understand it - or, search for more information if you need to. As far as Jupyter is concerned, that’s not a Manjaro related issue to be solved.
While I wish you well with your learning, I’m not here to teach.
It seems to be installed. Why are you trying to install it again?
See: Installing and Switching Between Python Versions, Setting a Local Python Version, Installation Problems, Issues with Switching Python Versions, etc.
Yes , it is installed but it is not available in jupyter. How can i switch to that version in Jupyter?
~ eval "$(pyenv init -)" ✔ 20m 30s
~ pyenv global 2.7.18 ✔
~ python ✔
Python 2.7.18 (default, May 25 2024, 11:26:23)
[GCC 13.2.1 20240417] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
but when i reopen terminal and type python it shows again python 3.12.3 version:
~ python ✔
Python 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
It is a virtual environment. Either enter it with some command or with environment variable per app. I do not think it is possible to change the version globally in manjaro - it will break the system after all, so be thankful it did not work.
So you have to figure out hot to start your app in the container, maybe install it there, or start it with a variable prefix, or change its startup script…but that can be better said by someone actually knowing that piece of software. I just gave you 3 ideas.