How to instal Python packages for Spyder - python

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

Related

Anaconda won't update spyder

I had Spyder 3.1.3 installed an running fine.
Then I heard about "anaconda navigator" - which I never had launched it before - so I launched it, took a look around, installed glueviz and quit.
Next time I opened spyder - not from the navigator, from the shortcut I've always used (with this command: C:\Anaconda2\pythonw.exe C:\Anaconda2\cwp.py C:\Anaconda2 "C:/Anaconda2/pythonw.exe" "C:/Anaconda2/Scripts/spyder-script.py" --new-instance), it launched spyder version 2.3.8.
Then I went to the command line and tried to update spyder with the conda update spydercommand and I get this:
C:\>conda update spyder
Fetching package metadata ...........
Solving package specifications: .
# All requested packages already installed.
# packages in environment at C:\Anaconda2:
#
spyder 2.3.8 py27_1
C:\>
nothing happens.
If I try to update it from the navigator (running as admin), I get an error saying "spyder cannot be installed on this environment"
Any ideas what can I do to properly update spyder?
EDIT:
I updated pandas and skpyder downgraded to version 2.2.0...
Thanks
With admin privilege type (if one does not uninstall before installing it gets 'stuck' for hours)
conda uninstall spyder
conda install spyder=5.1.5

Anaconda Installed but Cannot Launch Navigator

Anaconda (listed as "Python 3.6.0 (Anaconda 4.3.1 64 bit)" ) is in my programs and features list, but there is seeming no Anaconda Navigator desktop app, as their seems to be no icon on my desktop and I am unable to search for it through "Start". Could this be because I have the 32-bit version of Anaconda downloaded and I have a 64-bit OS (I thought I should do this because Python on my computer was 64-bit) or because I downloaded Anaconda under "users" instead of Desktop. I also downloaded Anaconda twice, if that could be causing some of the problem. I have a Windows 10 laptop, if that is any help.
Try to
source ~/anaconda3/bin/activate root
anaconda-navigator
https://github.com/ContinuumIO/anaconda-issues/issues/1580
Open up a command terminal (CTRL+ALT+T)
and try running this command:
anaconda-navigator
When I installed Anaconda, and read the website docs, they said that they tend to not add a file or menu path to run the navigator because there are so many different versions of different systems, instead they give the above terminal command to start the navigator GUI and advise on setting up a shortcut to do this process manually - if that works for you it shouldn't be too much trouble to do it this way - I do it like this personally
How I solved this issue:
1. Be connected to the internet.
2. Open the Anaconda Prompt (looks like a regular command window).
If you installed the .exe in your /name/user/ location you should be fine, if not navigate to it.
Then start an environment.
conda info --envs
Then run
conda install -c anaconda anaconda-navigator
Press y when prompted (if prompted). It will being downloading the packages needed.
Then run your newly installed Anaconda Navigator
anaconda-navigator
It should start, and also appear in your regular windows 10 apps list.
activate the virtual env with command:
conda activate base
run anacond anavigator
anaconda-navigator
when you will type anaconda in windows 10 search bar it will give you the list as
then in terminal you have to type anaconda-navigator as
it will start anaconda on your machine.
Yet another option which worked in my case on Windows 10: Try uninstalling your previous installation, restart the system and run the installation again. Make sure you don't start any programs before installing Anaconda. You will find the installation finishes without prompting any kind of errors.
Type in Anaconda in your Windows 10 Search bar. You will find Anaconda Prompt appear.
I figured out the reason as to why:
1-There seems to be no navigator icon
2-When conducting the above steps of running the "anaconda-navigator" command in prompt (whether cmd or Anaconda) it yields "anaconda navigator is not recognized as an internal or external command"
This was very frustrating to me as I'd installed the proper version multiple times with no avail.
To solve this problem :
in the installation process, there will be an advanced options step with 2 selections one of which is unchecked (the top one). Make sure you check it which will add the navigator to the path of your machine variables.
Cheers,
Hossam
it works :
export PATH=/home/yourUserName/anaconda3/bin:$PATH
after that run anaconda-navigator command. remember anaconda can't in Sudo mode, so don't use sudo at all.
I faced the same problem on Windows 10. As soon as I cleared my Path variable from edit environment variables option, the icon started to appear. It was occurring because I had previously installed python 3.6.1 on my computer and added it to my path variable as C:\Python36;C:\Python36\DLL; and so on. There isn't any need to uninstall Anaconda Navigator and start from scratch if you have correctly followed the steps mentioned at the documentation for it.
Try restarting the system! You will be able to find the navigator once you restart the system after installation.
Tried all solutions here but these 2 steps solved the issue:
1) manual update of open-ssl from here:
https://slproweb.com/products/Win32OpenSSL.html
2) update OpenSSL using conda update openssl command in the Anaconda Prompt
solved the issue!
I had a similar issue today where only the prompt was available after installation.
Finally solved this by un-installing my regular python installation and then install anaconda(anaconda 3 v5.2.0, with python 3.6).
I also have the issue on windows when i am unable to find the anaconda-navigator in start menu.
First you have to check anaconda-navigator.exe file in your anaconda folder if this file is present it means you have installed it properly otherwise there is some problem and you have to reinstall it.
Before reinstalling this points to be noticed
1) You have to uninstall all previous python folder
2) Check you environment variable and clear all previous python path
After this install anaconda
your problem will be resolved if not tell me the full error i will try to solve it
Uninstall your Anaconda, delete the folder where it was. Then reinstall it.
You might not be in a anaconda environment
Below is a link how to activate the environment from the official documentation
On Windows, in your Anaconda Prompt, run activate myenv
https://conda.io/docs/user-guide/tasks/manage-environments.html#activating-an-environment
And then run the anaconda navigator from the anaconda prompt by entering the command anaconda-navigator
100% Solved.
While Installing make sure you are connected to Internet.
If already installed anaconda, open the anaconda command prompt and type following command:
conda install -c anaconda anaconda-navigator
(internet connection is required)
Note: In some cases restarting may solve the issue of navigator.
This is what I did
Reinstall anacoda with ticked first check box
Remember to Restart
I have that error an the solution was to install the Win64 OpenSSL.
https://slproweb.com/products/Win32OpenSSL.html
Download and install Miniconda first from this link and later on download and install Anaconda. Then you will be able to see the navigator in your all programs list in the start menu. I hope this will help you. Let me know in case of any concerns.
In my case; it was available in the anaconda folder in "All App" from main menu
For people from Brazil
There is a security software called Warsaw (used for home banking) that must be uninstalled! After you can install it back again.
After thousand times trying, installing, uninstalling, cleanning-up the regedit that finally solved the problem.
First Run This Command
conda config --set auto_activate_base True
Then Run This Command
anaconda-navigator.
Turn off your internet connection, then open your terminal and type anaconda-navigator or type anaconda prompt in the search bar and double click on the anaconda prompt.
If anaconda is opened, then you can turn on your Wi-Fi.
I'm also faced with this issue. When I checked conda --version got a command not recognized error. Then I set the environmental variables as in https://stackoverflow.com/a/61372328/13370201. After that run anaconda navigator command. Then it started to initializing anaconda navigator.This tutorial also help for me.
I faced the same problem in Solus Baidge but I solved by activating the conda environment.
First activate
conda activate
Then run the navigator
anaconda-navigator
Make sure to run the installer as admin
In my case (Windows 11) it was a permission problem. Make sure to run the installer as administrator. You can check this by modification of the path in the installer process.
Further steps to handle the problem:
Uninstall your actual anaconda version.
Delete old Data found in:
C:\Users\YourUsername\AppData\Roaming
C:\Users\YourUsername
(In my case it was called .anaconda and .conda folder)
Restart PC
Install Anaconda as admin
The followng command solved my issue.
pip install --upgrade pywin32==228
On windows 10, I faced the same error - only Anaconda Prompt was showing in the startup menu. What I did is i re-installed Anaconda and selected install for all users of the pc (in my initial installation I have installed only for current user).
What finally worked for me was:
Uninstalling Anaconda
Deleting all files that has "conda" in them - most of them should be
located in: C:\Users\Admin
Delete especially the "condarc" file.
Reboot
Installed 32-bit installer (even though my system is 64-bit) and reboot
Finally worked. I have not yet re-tried with 64-bit installer, since I have a time critical project, but will do when again I have spare time.
P.S. what broke Anaconda for me was a blue screen I got while updating Anaconda. I guess it did not clear all old files and this broke the new installs.
I too faced a similar issue when I was not able to find the Anaconda Navigator Desktop app in the start menu. But do not worry , Go to start Menu and Type Anaconda Navigator. Now within the apps menu you will find anaconda navigator with its icon. Click on that. After clicking you will find a command prompt dialog opened and a .exe file runs on your machine. Wait till it completes.
The Anaconda Navigator app opens on your machine.

how to update spyder on anaconda

I have Anaconda installed (Python 2.7.11 |Anaconda custom (64-bit)| (default, Feb 16 2016, 09:58:36) [MSC v.1500 64 bit (AMD64)] on win32) and I am using Spyder 2.3.8
Would like to update Spyder to the latest version, so I went through the commands:
conda update conda
conda update anaconda
conda update spyder
They all ran without errors, but the spyder version didn't change - this is command I'm using to launch:
C:\Anaconda2\pythonw.exe C:\Anaconda2\cwp.py C:\Anaconda2 "C:/Anaconda2/pythonw.exe" "C:/Anaconda2/Scripts/spyder-script.py" --new-instance
Am I missing something?
To expand on juanpa.arrivillaga's comment:
If you want to update Spyder in the root environment, then conda update spyder
works for me.
If you want to update Spyder for a virtual environment you have created (e.g., for a different version of Python), then conda update -n $ENV_NAME spyder where $ENV_NAME is your environment name.
EDIT: In case conda update spyder isn't working, this post indicates you might need to run conda update anaconda before updating spyder. Also note that you can specify an exact spyder version if you want.
Go to Anaconda Naviagator, find spyder,click settings in the top right corner of the spyder app.click update tab
I see that you used pip to update. This is strongly discouraged (at least in Spyder 3). The Spyder update notices I receive have always included the following:
"IMPORTANT NOTE: It seems that you are using Spyder with Anaconda/Minconda. Please don't use pip to update it as that will probably break your installation. Instead please wait until new conda packages are available and use conda to perform the update."
Use this conda install spyder=4.0.0
This will not mess up your anaconda dependencies.
https://github.com/spyder-ide/spyder/releases
Simply select 'Update Application' after clicking on the settings symbol(top right corner) for Spyder in the Anaconda Navigator console. In my case I just updated it so it's in disabled state.
use this command
conda install spyder=5.0.1
this will install the new version or tell you the error
PackagesNotFoundError: The following packages are not available from
current channels
How to solve the error
1- update your anaconda
conda update anaconda
2- go to anaconda then spyder
or use this command
conda install spyder=5.0.0
make sure you in your base directory.
then conda install spyder will work.
Do it like this: conda install spyder=new_version_number.
new_version_number should be in digits.
One way to avoid errors during installing or updating packages is to run the Anaconda prompt as Administrator. Hope it helps!
You can easily install update version if you use Anaconda by closing Spyder and then running the following command in a system terminal (Anaconda Prompt on Windows, xterm on Linux or Terminal.app on macOS):
conda install spyder= Your desire version
(For example, Version is 3.1)
conda install spyder=3.1
Or you can use pip with this command in a system terminal (cmd.exe on Windows, xterm on Linux or Terminal.app on macOS):
pip install --pre -U spyder
Note: Do not use this command if you are using Anaconda because it could break your installation.
Using pip directly:
WARNING: This will break your Anaconda Installation as described by Spyder maintainer in the comments below; you can try this solution only if the solution mentioned above that use Conda do not work
pip install --upgrade spyder
You might get an error once launching the new Spyder "nbconvert >= 4.0: None (NOK)", which will require you to resinstall configparser:
conda uninstall configparser
conda install configparser
You should now have a fresh and up to date installation of Spyder.
In iOS,
Open Anaconda Navigator
Launch Spyder
Click on the tab "Consoles" (menu bar)
Then, "New Console"
Finally, in the console window, type conda update spyder
Your computer is going to start downloading and installing the new version. After finishing, just restart Spyder and that's it.
It's very easy just in 2 click
Open Anaconda Navigator
Go to Spyder icon
Click on settings logo top-right coner of spider box
Click update application
That it
Happy coding
My solution was uninstalla spyder and installa again.
Solved my problem:
conda uninstall spyder
conda install spyder=5

spyder/juypter not working after downgrading python

I had to download my python version from 3.5 to 3.4 because one of the packages I needed wasn't supported in 3.5. I downgraded the python version using the conda command prompt, and everything worked fine - got my package to install with all its dependencies and no conflicts. But now when I try to open Juypter notebook or Spyder, nothing happens. My IPython works just fine. I'm thinking maybe i have to downgrade Juypter and Spyder, but I'm not sure. Anyone have any ideas?
After a day of searching I finally figured it out.
I initially used
conda install python=3.4
Bad idea - ended up having to do a fresh install of anaconda to get spyder and juypter working again.
What ended up working is creating a separate environment.
conda create -n py34 python=3.4 anaconda
activate py34
... then install packages ...
This added spyder(py34), juypter(py34), and all its "py34 brothers and sisters" to my start menu. Using these new shortcuts/environment, I now have access to the packages I need by choosing the appropriate short cut. Yes, my start menu has extra python shortcuts now, but whatever - it works.
Just make sure Make sure you install the packages you're looking for before you close the anaconda console. Perfect for installing theano dependencies mingw and libpython.

Installing IbPy to be used in spyder (anaconda)

I have installed Anaconda and currently using Spyder IDE.
I am trying to install a package (IbPy -> https://github.com/blampe/IbPy) so that it can be used in Spyder.
So far I tried pip install ibpy, as well as conda install ibpy, but without success since the package is not available in the anaconda repository where I would normally update and download the most common packages.
I have also tried to move the folder downloaded from GitHub to the correct site-packages folder of Anaconda (C:\Users\Username\Anaconda2\Lib\site-packages), but still it does not work.
I also tried to run the setup.py (shift + right click on the folder, open new process here, Setup.py install), but without any success.
I tried to look for a solution everywhere, but I have had no luck so far.
If someone more tech savvy than me and practical with these specific could help, it would be highly appreciated.
You need to install it from github. Use the following.
pip install https://github.com/blampe/IbPy/zipball/master
You need to do a open terminal from the Anaconda Navigator and run the command:
conda install -c tibkiss ibpy2

Categories

Resources