I'm having trouble importing plotly using pip install. The error I get is as follows:
The following command must be run outside of the IPython shell:
$ pip install plotly
The Python package manager (pip) can only be used from outside of IPython.
Please reissue the `pip` command in a separate terminal or command prompt.
I'm very new to programming, so I simply tried this in the windows command prompt and it said "pip is not recognized as an internal or external command, operable program, or batch file". I'm using Spyder if that helps, but I'm not sure what I'm missing here.
Thanks for your help.
I guess you forgot to put ! before pip.
try:
!pip install plotly
in your notebook, should work.
For windows the cleanest way to install a python package is to:
python -m pip install [packagename]
This removes the ambiguity if pip is added to the path variable or not.
If you are getting below error while installing any python packages in window using command "pip install packageName".
The following command must be run outside of the IPython shell:
$ pip install configobj
The Python package manager (pip) can only be used from outside of IPython.
Please reissue the `pip` command in a separate terminal or command prompt.
See the Python documentation for more information on how to install packages:
https://docs.python.org/3/installing/
solution: add "!" at beginning of pip
!pip install configobj(packageName)
It will work. It worked in my case.
What worked for me was going to the directory in which Spyder is located, which you can do by searching Spyder on your computer and then right clicking → directory, and then in the directory opening the Anaconda Prompt. In this Prompt you can type in:
pip install [packagename]
and it will work.
Related
I have Spyder, clean Win10 installation, ver. 4.2.3.
When I run command pip, it gives message:
Note: you may need to restart the kernel to use updated packages.
C:\Users\UserName\AppData\Local\Programs\Spyder\Python\python.exe: No module named pip
I restarted Spyder, Win10, nothing helps.
How to fix it?
Thanks.
(Spyder maintainer here) We don't provide pip in our Windows app to prevent people breaking Spyder by installing any kind of packages with it.
The best way to use other packages that don't come with our app is to install Miniconda, create a conda environment after that with the packages you want to use and spyder-kernels, and finally connect Spyder to that env.
If you have python 3.4+ then pip should be installed with python.
To check that, you can run
pip help
in your windows command line.
However, if it isn't the case then download the get-pip.py file and run
python get-pip.py
and the pip installation should start. You can use pip help to verify this.
Another source of the problem might be that pip isn't listed in your PATH variables and thus isn't recognized by your command line.
Introduction
After I installed atom into my debian-ParrotOS for coding python. I've tried to search for flake8 for helping me to figure out the problems while writing code.
The Problem
after I installed linter-flake8 using this command: pip install flake8
It showed me that this line:
[Linter] Error running Flake8
See console for more info
What I've done
I tried several times to re-install linter-flake8. Even I tried to search multiple times for another alterative but all of them was not effcient as linter-flake8.
Fix Linter flake8
Description:
This's the solution for fixing the console problem which we're facing when we decide to install Linter-flake8 for Python3. It has been tested in Linux and Debian.
Why Linter-flake8 doesn't work after installation?
Linter-flake8 default installation meant to be for python 2.7 beside if you read the description of the package, you will also find that their implementation was for python 2.7 not for python3.
Default installation package simulates directly with python 2.7, not for python3. so, you have to install the package using the commands of python3.
Even after inserting your Executable PATH will be only mere of spectacular. Because you need to install flake8 in terms of python3, not python2.
So, What should I do?
Install Linter-flake8 From Atom and then restart your IDE.
Check if it's actually being installed via your package manager by executing: which flake8 in your terminal.
Reopen your IDE and click Ctrl+Shift+P to open the Search in Atom.
Search for Application: Open the Init Script.
Then, Write in the init.coffee this code:
process.env.PATH = ['usr/local/bin/', process.env.PATH].join(':')
Go To your *Executable PATH and paste this path /usr/local/bin/.
Then, open a new Terminal and execute these commands:
First, enter your root Mode by sudo su.
Second, go to cd /usr/local/bin/.
Third, execute these commands:
python3 -m pip install flake8.
ls
apm install linter-flake8
ls
python3 -m pip install flake8-docstring
python3 -m pip install hacking
If you didn't install pip before, then you can install it by sudo apt-get install pip and then, you can move on to continue the installation of flake8.
close your Atom and open it.
If you want to disable The Max Line Lenght you can do that by Default: 0.
Smile!
It will be a courtesy from you if you start following me :) <3
References:
flake8 not found
linter-flake8
I have multiple instances of python in my computer namely python27, python3.6 and python 3.7.
The import module for docx worked daily on python27 until suddenly it stopped working today. I tried installing the module again using pip in windows command line.
It says only installed in python27 directory. But there's an
importError on my script.
I guess I should be high time i transferred into python37 but I can't seem to make pip install into python 3.7
Can someone offer some advice as to the messy situation I'm in?I want to transfer to python3 and install docx in python3
Already checked modules using pip and docx is not there.
You should try setting your command prompt on the version of Python you want the module to install. Then, just use "pip", to install.
This is how you can do this:
Go into File Explorer (hopefully you have windows) and press and hold the shift key, then right click the folder that you want command prompt to look at. In this case, the folder with the version of Python. Then you click on the command prompt selection, and you're golden. Just use "pip install xyz" from there on. Glad to help
- BURAK ILOGLU
for python 3 try below given approaches.
sudo apt-get install python3-pip
this should get you pip3 and you can use pip3 to install packages specific to python3
and also
python3 -m pip install <package name>
I am trying to install TensorFlow. The installation instruction for Windows (https://www.tensorflow.org/install/install_windows) have as first step to install Python 3.5.2. And I'm doing the 'TensorFlow with CPU support only'.
Python was successfully installed in my computer as I can run it via the Start menu.
However, when I try to do the 2nd step of the installation instructions in order to install TensorFlow, this step says to:
To install TensorFlow, start a terminal. Then issue the appropriate pip3 install command in that terminal. To install the CPU-only version of TensorFlow, enter the following command:
C:\> pip3 install --upgrade tensorflow
But I'm getting an error when I perform the above statement, the error is
'pip' is not recognized as an internal or external command, oprable program or batch file.
I looked at several postings in StackOverflow and tried the commands provided in one of the postings, but I would get the same type of error.
So, how is 'pip3' installed? from what I read, it is supposed to be installed together with the installation, but obviously that did not happen.
How do I install it? I need to install TensorFlow and it seems that it needs to be done via the pip3 installation tool.
Thank you in advance for your help!
Either set the system environment path variable to include the python 3.5.x path in it, or just cd into the correct python folder to run pip3 from there.
The folder in windows 10 should be something like this:
C:\Users\YOUR_USERNAME\AppData\Local\Programs\Python\Python35\Scripts
Open the terminal, cd to that path (change YOUR_USERNAME to the correct user) and then just run the following command:
pip3 install --upgrade tensorflow
and if you want the gpu version:
pip3 install --upgrade tensorflow-gpu
Pip3 is already installed when you install Python, so there is no need to do anything else.
I just tried to install pygame for python 3.4 my windows computer, but apparently I need to extract the whl file? I have seen other questions like this one on stackoverflow and it says to write in commant prompt:
pip install package-name.whl
However, when I tried this, I got in return:
'pip' is not recognized as an internal of external command, operable program, or batch file.
Is this because I have Windows 10? Please help!
For me this command works.->py -m pip install -U pygame --user
But first, make sure you properly configure your environment variables.
This tutorial http://www.aaronstannard.com/how-to-setup-a-proper-python-environment-on-windows/ will help you how to setup environment variables for python, make sure you do it correctly only step 2 ,no need to do any other steps from this tutorial, now you can follow my steps that were listed below. I will assume that you have already installed python in your computer
Step1
Search for cmd and Right click on cmd and do run as administrator.
Step2
Run the command, py -m pip install -U pygame --user, but before you run this command first of all make sure you configure your environment variables properly.
Step3
Type python in command prompt, this will take you to the python command line which will look like this ">>>".If not then you have a problem with your system variables.
Step4
Make sure you are in python command line and then type import pygame,and after this press ctrl+z and enter that will take you out from python command line.
Step5
Make sure you are not in python command line and then run this command py -m pygame.examples.aliens,if the game starts then congrats you are done.
It can be possible that the pip/ wheel is not installed
follow this link to install pip link
If already installed maked sure it is updated if not
You can use this code to update: python –m ensurepip –-upgrade or pip install --upgrade pip
To install wheel pip install wheel or upgrade pip install wheel --upgrade
once this is done you are good to install pygame
At the command line, make sure you’re in the same directory as the .whl file and run
pip install package-name.whl
The issue is your pip isn't working correctly. To make sure it works, go to this folder C:\Python34\Scripts in windows explorer, hold shift and then right click. press 'open command prompt' here and then try to run pip.
That error occurs when the command entered, pip in this case, isn't found.
I just got pygame working on Windows 10 with these steps.
Download pygame-1.9.2a0-cp35-none-win32.whl from UCI.
Run the cmd shell and enter
> cd C:\Users\<me>\AppData\Local\Programs\Python\Python35-32\Scripts
> pip install C:\Users\<me>\Downloads\pygame-1.9.2a0-cp35-none-win32.whl
Start the Python 3.5 console. Therein enter
import pygame
dir(pygame)
No errors from either means that Pygame is ready for your command.
pip install pygame
that's all you need, just remember to use it correctly in your code
assuming that you have pip installed. You can run:
pip install pygame
in command prompt or a simulated terminal.
If you don't have pip already installed, please refer to this: (hope I helped!)
https://www.makeuseof.com/tag/install-pip-for-python/
I updated my pip, then ran the command prompt (cmd) as adminstrator, then I issued a python command:
-m pip install pygame
And it installed pygame.