The first time I have installed Python on my machine, it was Spyder with Anaconda.
But, with this version, I wasn't able to install pyodbc.
So, I have install Visual Studio Code and everything works fine
But today, I have tried to update some libraries (like certify or scipy) but each time I use pip install, I update my Anaconda folder and not my WindowsApps folder.
So, when I use PIP, how to update the Windows folder and not Anaconda. And also how to remove Anaconda from my computer. In my Windows Settings, I have no app related to Anaconda (weird)
Check your path, and which pip executable is being executed.
If you run it with the full path to your install in WindowsApps, then it should detect and update that version.
You can check which pip you are using with the command of pip --version.
Press win to open the start menu and search uninstall-a to find the Uninstall-Anaconda3.exe or open the control-panel to uninstall it. Like the official docs recommended.
Related
I am on Linux Mint. When i try to import robot for robotframework in my python application it doesnt get recognized as a installed library. This while i checked the executable with the "which" command.
which python
Gives the output: /usr/bin/python
I put that path '/usr/bin/python' in the interpreter path in vscode. But it doesn't get
the installed libraries.
when i use the terminal outside of vscode and do
pip list
I get a big list with all of my installed libraries. But when i do the same in VScode i just get a short list with nothing of the installed libraries.
I tried to deinstall python, vscode and reinstall both but that doesn't work. The python path to the system python.exe is in the PATH variables. I dont know what i can try further.
It looks like that they both point to the same pip instance but it doesn't recognize the same packages. Like it cant find the site-packages folder
Can anyone please help?
I've found the problem.
In Linux Mint when you install visual studio code via the application manager built into the OS. It installs the flatpack version of Visual studio code. Which creates what looks like its own environment that cannot get the pip packages from the main system.
For me what solved it was to download the .deb version from the official vscode website(https://code.visualstudio.com/Download) and install that one using the:
sudo apt install /Downloads/{name of downloaded.deb file}
When I used this version of Visual studio code it all worked for me with no problem.
I am doing this project where i need to install a package called Twint.
I want to install this package and use it's commands in my VS Code.
What happends when i for example type this in my Windows CMD?
pip3 install --user --upgrade git+https://github.com/twintproject/twint.git#origin/master#egg=twint
Because i can't type this in my VS code terminal, where i usually install packages with pip.
It will return an error that says ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?''
Now if i run this in my Windows Command it seems that i can't directly import the package in VS code?
Can anyone help me out with this confusion, where does the files get stored and how do i create good habbits around installing packages?
Hope someone understands what im struggeling with here.
Best
It is often the case that computers have more than one version of python installed and that editors like VS code use a different version than pip uses on the command line. pip installs packages where the version of python it is linked to expects them to be, but VScode doesn't know to look there.
It sounds like you have git installed where pip installs things, so you can upgrade from the command line without issue, but there's no installation of git where VScode is looking, so there's nothing to upgrade.
You either need to find where pip installs things and add it to the $PATH VScode uses, or try running a variation of python -m pip install --user git (specifying a specific url, or other things, as needed) from within VScode, which will ensure the package gets installed in a place that VScode looks for packages.
Download and Install git in your windows from here:
https://git-scm.com/download/win
Then add its installation bin path to your windows's environment path. Then you will find the git command at the command prompt globally.
This may solve you problem.
I recently downloaded and installed Python 3.9 because I wanted to run a website scraper to more easily organize recipes found online. However, when I try to run pip it says it doesn't recognize it (and I have tried editing the path but every video or site I find has different information).
Even a basic check of my Python version comes back with no results:
I have uninstalled and reinstalled Python 3.9 but to no avail. There is also no scripts file within my python file and my computer doesn't even seem to recognise that Python is installed.
In python 3.9 you can add below path(scripts path) to your environment variable
C:\Users\ASUS\AppData\Local\Programs\Python\Python39\Scripts
Once the path is added, open a fresh CMD window and type pip --version.
You can see your pip version pip 20.2.4
I found that for Python 3.9 if you enter the command as py -m pip install, the installation initiates as expected.
Annotation 2021-06-17 121518_install pywinauto Visual Studio Code terminal
I finally can use pip install.
Here is how I do it:
Run python 3.6.9-adm64.exe
Choose Modify
Tick all boxes and click Next
Tick [Create shortcuts...appplication](not important) and Add Python to environment variables and click Install
Now run CMD and type:
py -m pip install (name) //pygame for example
Now I installed pygame easily.
I have fixed this issue by running apt-get install python3-pip
on my Debian Linux.
every video or site I find has different information
This may be due to the fact that those sites provide information for different Python versions.
As Alfie Hanks already pointed out in the comments: The right way to do it is to check the box Add Python 3.x to PATH when installing Python 3 for the first time. When re-running the installer / re-installing choose "Modify" and check the box Add Python to environment variables. That takes care of setting the correct environment variable so that the Python and pip binary can be found by Windows.
If you have trouble finding those options, take a look at circlepi314's answer to a similar Python question: https://stackoverflow.com/a/54029728/6710751 This one has screenshots of the installer where those options are marked.
Install python again and when the prompt window opens, click on the modify button. Then check if pip is checked. If not then check it and then proceed with the install.enter image description here
If it still doesn't work, simply uninstall python. And then when you reinstall it make sure that the ADD to path checkbox is checked.
I had the similar problem, I managed to solve it with the following:
I installed python 3.9 by Brew on my Mac, so the pip3 was broken
I resolved by uninstalling python3.9 and installing 3.8
I've made multiple attempts to install Miniconda on my Macbook running Catalina. I've been following this guide on YouTube about how to install it. The area where I run into issues is when the installation completes and I have to restart the terminal. According to the video, this should allow me to use the conda command in the terminal itself, thus allowing me to do what I need to do. The error message I receive is below:
ERROR: The install method you used for conda--probably either pip
install conda or easy_install conda--is not compatible with using
conda as an application. If your intention is to install conda as a
standalone application, currently supported install methods include
the Anaconda installer and the miniconda installer. You can download
the miniconda installer from https://conda.io/miniconda.html.
What confuses me most about this is the fact that I have done this exact step. This current installation is from the link they provided. Has anyone else run into any issues like this?
I am writing some basic code in visual studio code and I am trying to use pynput, but when I import the module despite the fact that I installed it using pip it gives me this error:
ModuleNotFoundError: No module named 'pynput'
I have tried to install it using pip3, but it doesn't work
I have also tried to install it using the path interpreter, but it still doesn't work
This is the code:
from pynput.mouse import Button, Controller
mouse = Controller()
# Read pointer position
print('The current pointer position is {0}'.format(
mouse.position))
Strange thing is that this code works in sublime text 3,
but doesn't work in neither visual studio code nor cmd.
Thank you in advance.
Your package associations may be incorrect.
First, see where your IDE is running python. it should be something like C:\programData\Python
Reinstalling the python interpreter may fix this. Or try upgrading the pip, which uninstalls the old one, and pulls down the new one from the cloud. Open a CMD windows, and type the following command:
python -m pip install --upgrade pip --user
This will give you a fresh pip installation. Then try "pip install pynput"
If this does not solve the issue, uninstall your current interpreter, then go to python.org, and download and install the latest interpreter. Upgrade the pip.
if you are trying to run it from within the IDE, check the paths in witch it calls the python interpreter.
if it's pointing to any conda installation try conda install pynput instead
Most IDEs create an "interpreter" for your project, which in python-speak means that the IDE set up a "virtual environment" for you. Virtual environments are great for managing dependencies across different projects. For example if you need one version of pynput for one project and a later version for another project, you can do this with two separate virtual environments, whereas if you installed pynput on your system, upgrading pynput would break your first project. More info on virtual environments
When you open command line and run pip install, this installs the package onto your system interpreter. You'll instead need to 'activate' your virtual environment and run the pip install there. You can find the path to your virtual environment by opening your interpreter settings in your IDE. Then follow these instructions to activate your virtual environment and run the pip install on your project interpreter.
Try this
pip uninstall pynput
pip install pynput
or
install pynput using conda
conda install pynput