Martin
Martin

Reputation: 409

Pip install in Spyder

I'm using Python 3.6 through Spyder in Anaconda3. I have both the Anaconda installation and a "clean" python installation.

Before I installed the "clean" python, when I ran the Python -V command in cmd I got the following version description Python 3.6.5 :: Anaconda, Inc. Now when I run the command it just says Python 3.6.5. and the pip list is a whole lot shorter.

When ever I open Spyder and find some package that I don't have... how would I go about installing said package? If I just open cmd and write pip install ... it will install in the "clean" python directory. How do I tell it to connect to Spyder?

Upvotes: 12

Views: 252063

Answers (4)

jbartas
jbartas

Reputation: 337

There is a pip.exe included in the anaconda/Spyder package which can cleanly add modules to Spyder. It's not installed in the windows path by default, probably so it' won't interfere with the "normal" pip in my "normal" python package.

Check "/c/Users/myname/Anaconda3/Scripts/pip.exe". It seems to depend on local DLLs - it did not work (just hung) until I cd'd into it's directory. Once there I used it to install pymongo in the usual way, and the pymongo package was picked up by Spyder.

Hope that helps...

Upvotes: 0

joe souaid
joe souaid

Reputation: 40

I installed spyder without anaconda on linux, and i was missing a module, all i did was installing pip on the linux terminal sudo apt install python3-pip and then pip install "the library name " and it worked in spyder without any other modification.

Upvotes: 0

Sunny Gupta
Sunny Gupta

Reputation: 106

If you are using Spyder IDE easiest procedure which i found to install PIP is -:

Step 1- Check if Python is installed correctly. The simplest way to test for a Python installation on your Windows server is to open a command prompt (click on the Windows icon and type cmd, then click on the command prompt icon). Once a command prompt window opens, type python and press Enter. If Python is installed correctly, you should see output similar to what is shown below:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

Step 2-: Now in Step 2 Once you’ve confirmed that Python is correctly installed, you can proceed with installing Pip.

Download get-pip.py https://bootstrap.pypa.io/get-pip.py to a folder on your computer. Open a command prompt and navigate to the folder containing get-pip.py. Run the following command: python get-pip.py Pip is now installed! You can verify that Pip was installed correctly by opening a command prompt and entering the following command:

pip -V

You should see output similar to the following:

pip 18.0 from c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)enter code here

Upvotes: 5

Bastienm
Bastienm

Reputation: 393

I know it's a very late answer, but it may help other people. When you are working with anaconda you can use the basic environement or create a new one (it may be what's you call a "clean" python installation). To do that just do the following :

  • Open you anaconda navigator
  • Go to "Environments"
  • Click on the button create. Here by the way you can choose you python version

Then to install your lib you can use your Anaconda GUI :

  • Double click on you environment
  • On the right side you have all you installed lib. In the list box select "Not installed"
  • Look for your lib, check it and click on "apply" on the bottom right

You can also do it in your windows console (cmd), I prefer this way (more trust and you can see what's going on) :

  • Open you console
  • conda activate yourEnvName
  • conda install -n yourEnvName yourLib
  • Only if your conda install did not find your lib do pip install yourLib
  • At the end conda deactivate

/!\ If you are using this way, close your Anaconda GUI while you are doing this

If you want you can find your environement(s) in (on Windows) C:\Users\XxUserNamexX\AppData\Local\Continuum\anaconda3\envs. Each folder will contains the library for the named environement.

Hope it will be helpfull

PS : Note that it is important to launch spyder through the Anaconda GUI if you want Spyder to find your lib

Upvotes: 8

Related Questions