i wonder How to reload python package after pip install in Visual Studio Code?
pip install 'package-A'
pip list
Not exist 'package-A'
Restart 'Visual Studio Code'
Is the only way restart?
Thank u.
The best answer I've found is to use Developer:Reload Window like rioV8 suggested. You can either use the command palette or you can change the key mappings as described here. There's already a Ctrl + R key mapping for reloading the window, but its got a 'when' condition attached to it so I changed that to true. I also had to delete key mappings for other extensions so there was no overlap.
ctrl+shift+p and choose "Developer: Reload with extentions disabled"
You can do that using the Refresh Explorer (The reload button) right next to the directory/workspace that you opened up in the File Explorer.
You might have to hover for a while next to the workspace/directory name on the file explorer once it's expanded to have it in view.
You mean upgrade or re-install ?
pip install --upgrade --force-reinstall <package>
OR
pip install -I <package>
pip install --ignore-installed <package>
Try these commands
On MacOS, use command + shift + p and then choose "Developer: Reload Window". It is helpful to bind this to command + r. For Windows users, replace command with CTRL.
Are you sure this is a vscode issue? What happens when you run pip install from a normal command prompt? I suspect you will have the same issue, if that proves true, I would entirely uninstall python and re-install python, then install/upgrade pip to latest.
python -m pip install –upgrade pip
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 have installed python 3.5 on my Windows 7 machine. When I installed it, I marked the check box to install pip. After the installation, I wanted to check whether pip was working, so I typed pip on the command line and hit enter, but did not respond. The cursor blinks but it does not display anything.
Please help.
Regards.
Add the Script folder of python to your environment path
or you can do this from command line:
python -m pip install package-name
go the windows cmd prompt
go to the python directory
then type python -m pip install package-name
run it at the cmd window, not inside the python window. it took me forever to realize my mistake.
I was having the same problem on Windows 10, This is how I fix it:
Click the search icon and type System Environment
In System Properties click on Environment Variables
In System Variables tab click New
Enter PYTHON3_SCRIPTS for the variable name and C:\Users\YOUR USER NAME\AppData\Local\Programs\Python\Python38-32\Scripts for Variable Value. Don't forget to change (YOUR USER NAME) in the path with your user, And to change your Python version or just go to this path to check it C:\Users\YOUR USER NAME\AppData\Local\Programs\Python
Click OK
Click NEW again!
Enter PYTHON3_HOME for the variable name and C:\Users\YOUR USER NAME\AppData\Local\Programs\Python\Python38-32\ for Variable Value. Don't forget to change (YOUR USER NAME) in the path with your user, And to change your Python version or just go to this path to check it C:\Users\YOUR USER NAME\AppData\Local\Programs\Python
Click OK
Find Path in the same tab select it and click Edit
Click New and type %PYTHON3_SCRIPTS% Then click OK
Now, everything is set. Restart your Terminal and pip should be working now.
I had the same problem with Version 3.5.2.
Have you tried py.exe -m install package-name? This worked for me.
As soon as you open a command prompt, use:
python -m pip install --upgrade pip
then
python -m pip install <<package-name>>
If you are working in Pycharm, an easy way is go to file>setting>project interpreter. Click on the + icon you will find on right side probably and then search and install required library.
For those with several python versions of python 3 installed in windows: I solved this issue by executing the pip install command directly from my python35 Scripts folder in cmd...for some reason pip3 pointed to python 34 even though python 35 was set first in environmental variables.
I had the issue, and answered this same question sometimes ago. Do open a cmd if in windows OS or linux OS with admistrative privilege. Then python -m pip install --upgrade pip
then
python -m pip install <>
Working on windows and above version than 3.0
First upgrade pip to pip3 by following command:
pip3 install --upgrade setuptools pip
Then install maximum package by following command:
pip3 install <package_name>
I never wrote all package because some package not support to pip or pip3 command.
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.