Spyder doesnt recognize any installed packages, so doesnt load them - python

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).

Related

Does Spyder download its own Python with it?

Common issue here: I installed Python and then Spyder, and now when I install packages with "pip install ", Spyder can't find the modules, but if I call Python on the command prompt (using Windows), it finds all installed packages with pip.
I noticed that in Spyder, a new console shows it is running Python 3.7.9, but if I run "python -V" on the command promp, it shows Python 3.9.1 , also for "py -0" and "py -0p" it only shows one installation of Python, namely
>>> py -0p
Installed Pythons found by py Launcher for Windows
-3.9-64 C:\Users\my_name\AppData\Local\Programs\Python\Python39\python.exe *
so what is going on here? Why does Spyder seem to have its own Python version? Is this the reason why packages installed with pip are not communicating with Spyder?
I was facing the same issue as you. I understand your question and the answer to it is yes. However you can change it and use the systems python as well.
Tools -> preferences -> python interpreter -> select "use the following interpreter" and provide is the path to the directory that you have the systems python installed.
Restart spyder and the kernel should then show you the update version
For any library that you want to add that is not included in the default search path of spyder, you need add its path via the PYTHONPATH manager.
Go to Spyder->Tool-> PYTHONPATH manager ->Add Path

PIP version VSCode

I am having troubles trying to understand why VSCode uses a different pip version.
I have two python versions installed in Windows, python38 and python39, if I open the win 10 terminal I got pip version 20.2.4 when running pip3 --version, but if i run the same command inside the VSCode terminal i got pip 20.2.2 from c:\python38\lib\site-packages\pip (python 3.8).
Both terminals are running PowerShell 7.0.3 on the same profile.
Also removing python38 from the global PATH variable gives command not found error only in vscode, in windows terminal keeps working as i described before.
Could not fix this so I deleted all temporary and profile data of vscode and can now run pip from within its terminal.
Try changing your interpreter: ctrl+shift+p->select python interpreter and choose the one you want because pip is part of the python environment, and therefore the version of pip you are using is tied to the active python interpreter (cc #DragonBobZ)
It's all about the Process PATH. Check $Env:PATH in both. Starting from the left, the first folder with pip3.exe is used. You have probably selected a python interpreter for VS Code, which then adds it in the PATH.
You can also check the location of the used pip3.exe with Get-Command pip3. (might be helpful in debugging)
It appears something got fixed after deleting all profile and settings data from visual studio code, it runs pip now form the terminal inside vscode.

How to instal Python packages for Spyder

I am using the IDE called Spyder for learning Python.
I would like to know in how to go about in installing Python packages for Spyder?
step 1. First open Spyder and click Tools --> Open command prompt.
For more details click visit this link,
https://miamioh.instructure.com/courses/38817/pages/downloading-and-installing-packages
I am running Spyder 4.2.4 and for me following solution turned out to be working:
open tools-> preferences -> python interpreter
click 'use the following python interpreter'
point the location to local python installation, in my case : C:\Users\MYUSER\AppData\Local\Programs\Python\Python37\python.exe
Click OK and restart the kernel.
Now the pip started to work and I was able to import any package I previously installed on the cmd/python CLI.
Spyder is a package too, you can install packages using pip or conda, and spyder will access them using your python path in environment.
Spyder is not a package manager like conda,, but an IDE like jupyter notebook and VS Code.
For the latest versions of Spyder use this console
at right bottom
Note: Once you hit enter it may take some time to install and you can't see the progress until it finishes.
Else:
Open anaconda command prompt
Activate your environment: conda activate env-name
Install the package: conda install your-package-name
I have not checked if the ways described by people here before me work or not.
I am running Spyder 5.0.5, and for me below steps worked:
Step 1: Open anaconda prompt (I had my Spyder opened parallelly)
Step 2: write - "pip install package-name"
Note: I got my Spyder 5.0.5 up and running after installing the whole Anaconda Navigator 2.0.3.
I installed Basic Python IDLE(python 3.9)
As I used to Spyder. I installed a standalone Spyder from https://www.spyder-ide.org/
Then I faced problems for packages
I tried this one
pip install spyder spyder-terminal

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 python3.7.0?

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

Categories

Resources