How to install python3.7.0? - python

I am running a program on ubuntu that requires python 3.7.0, and I dont know how to install it
I have tried anaconda and created an environment, but it didn't work
I have also tried to install python 3.7.0, but when I do python -V, the version is still the 3.6.2 version.

Very interesting things happen.
When I install python3.7, and changed it as the default interpreter, the terminal won't open anymore. I had to change the default back to 3.6 to get terminal to open.
Anyway, I was able to create a virtual environment using anaconda and it works fine. Thank you all for you help

Related

Python upgrade issue from 3.9 to 3.10 on Windows

I had a Python 3.9 installed on my Windows 10 machine and it had a lot of issues, so I had to upgrade it to Python 3.10
I uninstalled Python 3.9 from my machine, and installed 3.10, and added it to PATH.
I also had a Python 3.7 instance as well.
Now after installing Python 3.10, pip and virtualenv are not working anymore, when I try to install virtualenv using pip, I get this error:
Fatal error in launcher: Unable to create process using '"c:\users\wwwwww\appdata\local\programs\python\python37\python.exe" "C:\Users\wwwww\AppData\Local\Programs\Python\Python37\Scripts\pip.exe" install virtualenv': File not found
Even after uninstalling Python 3.9, I can still see 3.7 and 3.9 on my machine:
When I try python on my Visual Code terminal, I get the shell and everything works fine:
But when I try to run it on Git Bash, I get nothing, and the terminal crashes:
I want to reset everything and remove all python and pip so I can start from scratch and continue my work because I'm blocked right now.
The problem is with Windows 10 and their decision to automatically enable Python as an execution alias, and thus impacting the command line behavior.
To solve this issue, simply go to Windows Parameters -> Apps and Features, and search: Manage Apps Execution Aliases.
Uncheck every Python mention in the list:
And now the problem is solved:

Spyder doesnt recognize any installed packages, so doesnt load them

I have been dealing with this problem for months and still found no solution.
I installed anacond first, and then installed spyder (but not from anaconda interface, but from outside it). I want to use spyder but when I open cmd terminal and type "pip install pyarrow", the cmd shows it is already installed but spyder doesnt load it.
Thank you very much/
Maybe Spyder is running a python interpreter version (say 3.7), but the pyarrow package was only installed for a later version (say 3.8).
Try this:
Check your Python interpreter version
Check for which versions of Python was Pyarrow package installed.
Spyder runs a python interpreter by default and you can change which version to run:
Go to Spyder --> Preferences --> Python interpreter --> Use the following python interpreter (insert the path of the desired python version).

Python not recognised in windows prompt cmd

Anconda prompt:
where conda
C:\Users\shail\AppData\Local\Continuum\anaconda3\Library\bin\conda.bat
C:\Users\shail\AppData\Local\Continuum\anaconda3\Scripts\conda.exe
C:\Users\shail\AppData\Local\Continuum\anaconda3\condabin\conda.bat
where python
C:\Users\shail\AppData\Local\Continuum\anaconda3\python.exe
C:\Users\shail\AppData\Local\Microsoft\WindowsApps\python.exe
So i went to environment variables and added path of anaconda and python. Path added:
C:\Users\shail\AppData\Local\Continuum\anaconda3
C:\Users\shail\AppData\Local\Microsoft\WindowsApps
C:\Users\shail\AppData\Local\Continuum\anaconda3\Library\bin
C:\Users\shail\AppData\Local\Continuum\anaconda3\Scripts
C:\Users\shail\AppData\Local\Continuum\anaconda3\condabin
But when I type on windows cmd:
C:\Users\shail>conda --version
conda 4.8.3
C:\Users\shail>python --version
C:\Users\shail>
So there is no response from windows cmd on version of python, so I guess it is not recognising python. I mainly need to use pip command, for that I need python first. I dont have python separately installed on system. It is inside my anaconda. On some sites it is written I should not download python separately and add its path because that will confuse the computer since there will be 2 pythons; one from Anaconda and one downloaded separately. So sticking to the anaconda version of python.
How to get my anaconda version of python recognised ?
pip worked for me after restarting my computer. Though python is still not returning any output but pip is working fine.

Using Spyder with Python 2.7 and Python 3 on Linux

I am working on a Python 2.7 program. I am not used to use Spyder, I usually use vanilla Python form the terminal. Since my calculation are quite heavy I would like now to use Spyder just to do the plotting without having to run the whole calculation. Basicly I want to use the Spyder because it keeps the variables in a workspace and because it provides the possibilty of messing around with the plotting without having to run a full calculation every time.
I installed Spyder with
sudo apt install spyder
How should I use this installation to choose whether Python 2.7 or Python 3?
What I tried
I also tried to install Spyder throught pip as suggested here like so
python -m pip install spyder
which is not working. So I forced pip to install a specific version of Spyder with
sudo pip install -Iv spyder==2.3.9
but again there is an issue with dependencies. And even if it had worked, it wouldn't have allowed me to select the version of Python. It would only have installed a version of Spyder that works with Python 2.7.
Changing Python interpreter as suggested here doesn't work either. I tried to specify bin/python as Python interpreted but it doesn't work with the IPython kernel.
Solution
As mentionned below the solution is to use conda and virtual environments for each Python version.
I'm not sure if I got your question right,
but if you are not sure how to change the Python interpreter in Spyder, then take a look into this post: How to change python version in anaconda spyder
If you want to run spyder,
just type spyder into your terminal.
If you want to use multiple versions of python consider to use virtual environments created by virtualenv or conda.
For this, take a look into this article: Conda: Creating a virtual environment
Rgds

How to install Spyder for Python 2 and Python 3 and get Python 3 in my Spyder env?

I have Python 2.7 installed (as default in Windows 7 64bit) and also have Python 3 installed in an environment (called Python3).
I would like to use Spyder as my IDE. I have installed Spyder3 in my Python3 environment, but when I open Spyder 3 (from within my Python 3 env), then it opens Spyder for python 2.7 and not python 3.5 as I would've hoped for.). I don't know why.
I have done TOOLS--Preferences--Python Interpreter -- Use the following Python interpreter: C:\Users\16082834\AppData\Local\Continuum\Anaconda2\envs\Python3\python.exe, but this didn't work either.
Many of us are running multiple python environments; I am sure some of you might have managed to use Spyder for these different environments.
Please tell me how I can get Python 3 using this method.
One possible way is to run activate Python3 and then run pip install Spyder.
So, when you create a new environment with: conda create --name python36 python=3.6 anaconda
This will create an env. called python36 and the package to be installed is anaconda (which basically contains everything you'll need for python).
Be sure that your new env. actually is running the ecorrect python version by doing the following:
activate python environmentwith: active python36
then type: python
this will indicate what python version is running in your env. It turns out, for some reason, my environment was running python2.7 and not 3.6
The cool thing is that anaconda distribution comes with spyder. Just be sure that you run Spyder from within your environment.
So to do this: activate python36
then type: spyder
It will automatically open spyder3 for python3.
My initial issue was therefore that even though i created a python3 environment, it was still running python2.7. But after removing the old python3 environment and creating a new python3 env. and installing the desired libraries/packages it now works perfect.
I have a 2.7 and 3.6 environment which can both be edited with spyder2 and spyder3 IDE

Categories

Resources