I am running a raspberry pi with an armv7l image, and I want to use python 3.8 as my base version. This image of raspbian comes with python 3.4 and python 2.7. I downloaded python3.8 and manually compiled it.
However, all previous version of python reside in /usr/bin and /usr/lib while my manually compiled version resides in /usr/local/bin.
When I run conda info, the output says python version : 3.4.3.final.0
and when I run conda search python the output says python 2.7.10 and python * 3.4.3.
My question is, how do I get conda to recognize the python version 3.8.2 that I've manually compiled and installed?
I've tried searching around the internet but the only answers I've found are ones in which you install a new version of python instead of adding a version you already have.
Related
I have a Raspberry Pi 3 with Raspbian and I upgraded python version from 3.7 to 3.8. If I type python --version in the terminal the correct version appears as the system version. However none of the modules that I have installed AFTER the version change seem to work. Python gives ModuleNotFoundError when trying to import ANY of the modules that I have installed.
I can see the modules with pip freeze but Python seems to not be able to find them.
I followed this instructions to purge 3.7. I reinstalled pip after purging python 3.7 but pip as again installed in /home/pi/.local/lib/python3.7/site-packages/pip. How can I get rid of 3.7 completely?
python3.8 -m pip install SomePackage # specifically Python 3.8 should work.
More documentation here: https://docs.python.org/3/installing/index.html#work-with-multiple-versions-of-python-installed-in-parallel
Just to summarize the comments and suggestions from other answers:
The problem I have was caused by the fact that even I had set Python 3.8 as default and python -v was pointing to Python 3.8 the pip script was installing modules for Python 3.7.
The suggested solution was to use pip3.8 (or whatever version someone might have) to install packages for that equivalent Python version and that works good.
Ideally best option if someone wants to have multiple versions of python is to use pyenv. You can create multiple virtual environments with multiple python versions.
However Do not uninstall the default Python. I have also tried to uninstall the default Python 3.7 to avoid having two versions of python 3 and keeping track of which module is installed where. This was a bad idea. I did not know that many Linux distributions have applications which use the default Python. You might get a black screen and who knows what other problems see this discussion Removed Python 3 on 18.04, how can I fix my system?
I'm currently using Mac Pro and downloaded python through brew install python for the latest version (though it downloaded 3.9.12 instead of 3.10.x).
Also, while playing with the command lines, I also installed pyenv (version 2.2.5).
The problem is, I am now unable to get the default python version.
The command python --version and python -h all gives me zsh: command not found: python.
However, when I do python3 --version, it gives me Python 3.9.12.
Did I mess things up? Is there are way to go back to the state before I altered anything? (or at least recover my default python version?)
What version of MacOS are you running? Starting in 12.3, Python2 was removed from the system.
https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes
Python
Deprecations
Python 2.7 was removed from macOS in this update. Developers should use Python 3 or an alternative language instead. (39795874)
currently I am using python 3.7.2 ,I want to to change my python version with
3.7.1 ,I want only 3.7.1 not both how can I do that without changing settings
of environment variables .I have pip installed in my pc.
I have searched on many blog but they were regarding using multiple python version.
My main target is to install python vs 3.7.1 with Django 2.1.5
I believe you can specify python version when running things:
py -3 setup.py # run latest Python 3
py -2 setup.py # run latest Python 2
py -3.3
py -2.7-32 # use 32-bit version
py # run default version
But if you want to completely get rid of the other version just uninstall and reinstall that other version....
Reminder: This is for Windows CLI only.
And like #Reez0 said, you should really look into using Virtual Environments.
I have the 3.5 version of python. I want to install Anaconda, but it says on the Anaconda website the latest version of it is for Python 3.6. My question is could I still use the packages for Python 3.5, or should I install Python 3.6?
When you install Anaconda Python, it installs into its own area and wouldn't conflict with an existing Python installation. If you already have additional Python packages installed, you will need to reinstall them for the new Python installation, preferably using a Python virtual environment. You can't use a Python virtual environment from an existing Python installation and would need to create a new one against Anaconda Python if already using one.
If your own personal code works with Python 3.5, it likely will work with Python 3.6 no problems.
So with the above caveats on re-installing additional Python packages, there shouldn't be any reason why you couldn't use Anaconda Python 3.6.
I had the same problem where I couldn't run anaconda with python 3.6. What I did was to install anaconda with python 3.5. Go to https://repo.continuum.io/archive/ then download Anaconda3-4.2.0-Windows-x86_64.
I've never used virtualenv, I'm working on Ubuntu 15.04 (remotely via ssh), and I've been told I can't make any changes to system the Pythons. Ubuntu 15.04 comes with Pythons 2.7 and 3.4.3, but I want Python 3.5 in my virtualenv. I've tried virtualenv -p python3.5 my_env and it gives The executable python3.5 (from --python=python3.5) does not exist, which I take to mean that it's complaining about the system not having Python 3.5. So, is it impossible to create a virtualenv with Python 3.5, if the system does not already have Python 3.5?
You can just install the latest version of python. You can also download and install the different versions in your user's home dir.
In case you are planning to have multiple versions installed manually. This is from the offical python README file.
Installing multiple versions
On Unix and Mac systems if you intend to install multiple versions of Python using the same installation prefix (--prefix argument to the configure script) you must take care that your primary python executable is not overwritten by the installation of a different version. All files and directories installed using "make altinstall" contain the major and minor version and can thus live side-by-side. "make install" also creates ${prefix}/bin/python3 which refers to ${prefix}/bin/pythonX.Y. If you intend to install multiple versions using the same prefix you must decide which version (if any) is your "primary" version. Install that version using "make install". Install all other versions using "make altinstall".
For example, if you want to install Python 2.5, 2.6 and 3.0 with 2.6 being the primary version, you would execute "make install" in your 2.6 build directory and "make altinstall" in the others.
Once done that you can continue using the virtual environment for python using the python version of your choice.