As the Anaconda Distribution of Spyder has some typing latency issues on macOS Big Sur, I've gone ahead and downloaded the standalone distribution. However, when trying to install packages with pip I get the error message:
pip install numpy
/Applications/Spyder.app/Contents/MacOS/python: No module named pip
Note: you may need to restart the kernel to use updated packages.
(I know that NumPy is already installed - this just serves as an example). I have Anaconda installed, and there pip works fine. How do I install it for the specific Standalone Distribution?
I solved this problem using the Command Prompt and typing pip install -U spyder. If you don't have the "standalone version" of Python, just install it to have access to this command.
After that, you can simply open Spyder typing in the Command Prompt spyder.
Related
I am trying to install mmcv python package, but Ubuntu terminal crashes every time during installaction (application simply closes without any errors). I tried to install this package both using standard Linux terminal and via VS Code - the result is always the same. It causes no errors when I install other python packages, but when I try to install mmcv - terminal crushes.
I am using this code for installation:
pip install mmcv-full==1.3.9 -f https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.1/index.html
I tried to install mmcv using this code in Kaggle Kernel (it is Jupyter Notebook-like development environment, which works on Linux too) - and package was installed correctly.
It seems to me that my terminal crashes because mmcv is quite "heavy" python package, but I do not know what to do with it. How can I solve this problem and install mmcv?
It seems like my version of Ubuntu is not compatible with old versions of mmcv.
This code worked for me:
pip install -U openmim
mim install mmcv-full==1.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
Did pip install pdfrw, uninstalled and reinstalled, restarted my laptop, but still unable to import the specified package as it returns error: No module named 'pdfrw'.
https://pypi.org/project/pdfrw/#pdfrw-philosophy
Any advice is appreciated.
Update: Tried installing by cmd, I'm using Jupyter Notebook as IDE :)
You have to make sure that the Python that you are using with Jupyter Notebook is the same that the one for which you are installing that package. If you have several Python interpreters installed or if you installed Ananconda to use Jupyter, you have to take care of which pip are you invoking from CMD.
If you are using Jupyter from Ananconda, try to install the package using conda.
conda install pdfrw
Another thing that you can do is open a Command Prompt and type:
where python
you will get the path to the interpreters that you have installed. In my case I get:
>>> C:\Windows\system32>where python
C:\Python39\python.exe
C:\Python38\python.exe
>>> C:\Windows\system32>where pip
C:\Python39\Scripts\pip.exe
C:\Python38\Scripts\pip.exe
Then you can use a concrete interpreter to call pip, in my case I will do:
C:\Python39\python.exe -m pip install pdfrw
After the installation finish, invoke the same interpreter you use to call pip:
C:\Python39\python.exe
Then try to import pdfrw. If you can import it, then the problem is that you are using a different interpreter in Jupyter Notebook.
I first installed Spyder and then afterwards Python on a server (with Windows Server 2019) all on the directory "C:\Users\wi932\ .spyder-py3" and the Python folder "C:\Users\wi932\Python\Python38". Then I installed many packages (like tensorflow, matplotlib, scikitlearn) by using the command prompt of windows and pip from the directory "C:\Users\wi932\Python\Python38\Scripts" and it was okay.
However, when running Spyder I can't use the packages that I installed using pip. Whenever I run a Python programm with those modules I get an error message "ModuleNotFoundError: No module named 'tensorflow'". So the question is how can I build a "connection" between the pip and Spyder?
Does anyone have an idea? I'll appreciate every comment.
Have you considered installing anaconda?
Spyder comes as a part of this and is easy to install from the anaconda client. You can also create your base environment in the anaconda client and then switch to pip to install packages from there.
I need to upgrade to numpy 1.14.3 on a Windows computer. I tried using pip install numpy --upgrade in the command line and got 'pip' is not recognized as an internal or external command, operable program or batch file. and the same message that pyton is not recognized when I try python pip install numpy.
Based on some googling it seems the issue is because python or pip are not added to the path. However, I am using a school computer and cannot access any advanced settings in order to add pip to path.
Is there an alternative command line upgrade method for numpy on windows?
If you have it installed, use Anaconda Navigator. Go to the Environments tab, and update whatever packages you need by filtering packages by upgradable! See screenshot below:
Since the asking user said he/she can’t upgrade to the version they need, try activating a new environment in the Anaconda Prompt, which should give you the latest version of numpy:
conda create -n TITLE_OF_ENVIRONMENT ipython-notebook numpy matplotlib pandas
Update of what worked for the user
Make sure that you run the pip command in the Anaconda Prompt and not in cmd! The pip command worked in the Anaconda Prompt, and the user was able to download the newest version of numpy.
I have recently installed Anaconda with Python 3.5 and all the rest. I come from R where I am used to install packages dynamically. I am trying to install a module called scitools through jupyter notebook. I would like to recreate this in jupyter. However, I don't know how to dynamically install packages (if it's possible). I would greatly appreciate your help. Thank you!
EDIT: I am trying to use conda as recommended by the community, but it's not working. I am using mac OSX
Check Jake Vander Plus Blog here to learn how to install a package with pip from Jupyter Notebook.
# Install a pip package in the current Jupyter kernel
import sys
!{sys.executable} -m pip install numpy
So if you have already done the install with anaconda, you may already have the module installed. In that case in your jupyter notebook after you have activated your kernel, you just need to make sure you execute the import statement.
import scitools
If you haven't installed that module yet, you can install it one of two ways. Both work from your command line or terminal.
pip install scitools
or since you have Anaconda
conda install scitools
and that should do it. Your import statement in your notebook when executed should correctly locate and enable the use of that module.
I had the same issue. It turns out if you open an anaconda window, which in Windows is accessible under the Anaconda drop down, it points to the correct location to install (or update) using pip.