I have a problem just like the one in this thread:
pip install BeautifulSoup nothing happens
I saw the solution to the post and figured that I didn't need to worry about whether or not I installed pip correctly since later versions of Python come with pip (I installed python only a few weeks ago). I also tried downloading get-pip.py and running it in the CMD like the solution said and it says the python is not recognized as an internal or external command etc. I'm assuming it's because there might be something wrong with my environment path variable?
Currently it is: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Python27\scripts
Is there something wrong?
Try to turn off your firewall. (At least it helped in my case when I faced similar problem).
Related
I'm installing a bunch of python modules on my system that are specific to this code I am going to be working with. Specifically, I used pip install pyda to get the pyda module. To make sure I had gotten all the modules, I went through and ran some of the code snippets, and came across the following error:
ModuleNotFoundError: No module named 'pyda.utilities'
I tried using pip install pyda.utilities, but that honestly doesn't make sense, it should have just come with the pyda module. According to this website https://pypi.org/project/pyda/ it seems like it should come with the package. I tried determining if I just installed it in the wrong python version, but I'm having a difficult time forcing it to use the specific python version that I installed the module in (specifically, I tried to create an alias for /usr/bin/python3.7 or something like this as I have seen on other websites, but it just fusses at me that this is simply a directory, incredibly unhelpful because I can't find the corresponding executable, so I'm a bit confused here).
This is a very long question likely with a very simple answer, any thoughts or help on what the issue might be would be appreciated.
Edit: I have determined that it's a package problem, not a python problem. The command 'pip install pyda' is not actually installing everything, oddly enough, which is why it cannot find the pyda.utilities module. Unfortunately, I think this means I will have to install the package manually. I will keep this question posted because of the useful answer on virtual environments, so thanks everyone.
The answer is indeed straightforward. As #Chris indicated in the comments, start using virtual environments.
It's not as complicated as it sounds and there's plenty of tutorials on getting started with virtualenv for Python, like https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/26/python-virtual-env/
The basic steps:
check you're using the version of Python you want in your virtual environment
if you don't, change directories to where it lives
ensure you have pip and it works
check if you have virtualenv and if you don't pip install virtualenv
create a virtual environment virtualenv /your/env/folder/here
activate the virtual environment with /your/env/folder/here/Scripts/activate
After that, just install the packages you need with pip and they will end up in your virtual environment, with no interference from other Python versions or packages.
Check your python version, if it does not work restart your computer and try run setup.py install on the python command line
Have reviewed the highly popular thread below, but cannot seem to find a resolution.
'pip' is not recognized as an internal or external command
I was having issues with the below issue, when trying to use CMD to pip install anything:
'pip' is not recognized as an internal or external command
Eventually was convinced it was my Python installation which may have been all over the place, so took the decision to completely remove and install fresh. Upon doing this, I managed to then successfully install something via 'pip install ', which in this case was pyinstaller.
However, having since turned off/on my PC, I now have the same issue again? When I go into my Python directory, there is no pip files/folder in :
C:\Users\Jon_D\AppData\Local\Programs\Python\Python38-32\Scripts
C:\Users\Jon_D\AppData\Local\Programs\Python\Python38-32\libs
C:\Users\Jon_D\AppData\Local\Programs\Python\Python38-32\Lib
In fact, there is now a pip folder within the higher Programs directory:
C:\Users\Jon_D\AppData\Local\pip
Not sure what has caused this given it was a completely fresh install, which included adding a PATH entry.
I hope this will help you
python get-pip.py
If python doesn't recognise you can you py instead of python
Relatively new developer here, and this is my first time posting. For two days I have been searching for the answer to the issue I have been having, following guides and such but I seem to keep digging myself into a deeper hole with this one. So I decided to post here for help
What is happening is it appears that I have python installed properly, but when I run echo $PATH in terminal I get this:
/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/python3
I have tried editing the ~/.bash_profile to make sure that the correct path is listed, and currently it appears as:
/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}
I'm assuming that having the ${PATH} there may be what's causing it to continuously echo as it is, but I'm not sure about removing anything since I don't want to screw things up.
Also when using sublime text 3 I can't get similar errors, I'm assuming because it's not correctly finding the path. I'm not able to build until I can find a way to resolve this, but for the moment at least I am at a loss.
Any help would be greatly appreciated!!!
Install Homebrew and then install python with brew install python
See if you have python installed with brew by ll /usr/local/bin/python*
/Library/Frameworks/Python.framework/Versions/3.6/bin part in your path is duplicated. Remove them and keep your path as /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/python3
Seems like you downloaded Python 3 from python.org. You should uninstall and use homebrew.
Uninstall whatever you downloaded from python.org by replacing 2.7 with 3.6 in these instructions. This should fix your path. From now on, don't mess with it (leave ~/.bash_profile empty). Homebrew handles that.
Reinstall Python with homebrew brew reinstall python, I would personally install with tcl-tk: brew reinstall python --with-tcl-tk which will make idle3 run without warnings.
I think i somehow messed up installing packages for python and the whole environment. Whenever i want to install something i run into problems like:
directory is not owned by the current user and the cache has been disabled
Also PyCharm thinks i still need to install referenced packages (no modules. Which is wrong since i can use them. When i click on 'install referenced packages' i get the mentioned warning from above plus:
OSError: [Errno 1] Operation not permitted
Hopefully one of you can help! :(
Best regards
Matthias
Edit: At some point i also installed a venv for python. Maybe this relates to my problem. I'm rly sorry i am new to it and have no idea what i'm doing.
You have an issue with your permissions, if you run
which python
you will see where your current version of python is installed. If you're on osx, I seriously recommend downloading brew here: https://brew.sh/. Just paste that command into your terminal, then you should install python by running:
brew install python
This will give you some later instructions, but the brew bundled version of python is alot more robust than the one that gets bundled with your system. Another note is that if you're using virtual environments, consider using virtualenvwrapper here. This should make things run alot more smoothly for you :)
Hope that helps.
I recently installed Python for Windows 10 and need to use pip command to install the requests package.
However, whenever I try to use pip in cmd it just freezes my command prompt.
Using CTRL + C, CTRL + D or any command like that to cancel it does not work either, the prompt just freezes like its waiting for input or something, but I get no output or any clue about what to do.
I have set the PATH variable correctly, and my computer finds pip and launches it, but it just freezes. I have also tried reinstalling Python countless times and manually reinstalling pip but nothing seems to do the trick.
I had exactly the same problem here (Windows 10.0.10240). After typing just "pip" and hitting enter, nothing else happened on the console. This problem was affecting including other .exe compiled python related scripts like mezzanine-project.exe.
The antivirus AVAST was the culprit (in my case) !!!
After disabling AVAST files module (or uninstalling AVAST) pip started working again.
i didn't think i had the same issue as #Marcio, but the longer it went on, it turned out i did.
In avast, goto the settings, goto Active PRotection, go to File System Shield and add an exclusion for
C:\Python27\Scripts
should work without a reboot, did for me, I was having issues with the Virtualenv.exe which is in that folder.
Try to use easy-install insted of pip it works in the same way.
#eryksun provided what I think should be the answer to this question. I also have had the command prompt hang whenever I try to use pip, but I do not want to use easy_install. The solution (from #eryksun) was to use python -m pip install package_name. This works great for managing python packages in windows 10.
Marco's answer worked perfectly but the actual solution to the problem is that you should write your pip commands using python -m pip instead of just pip
so your command will be python -m pip install requests
I had this exact problem with the numpy module. The only way I could fix it is by following the steps found here: Installing NumPy and SciPy on 64-bit Windows (with Pip)
The steps were to
Download the appropriate precompiled wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs/
Type pip install /path/to/module.whl
This worked perfectly for me. Hope this helps anyone else with this exact issue.
Well, when you run python -m pip, it actually starts pip.exe as a child process, so in the end it freezes the same for me, although it runs a bit longer...
Worse is that the pip.exe process is completely zombie, no way to kill it even with ProcExpl....
I had the same problem. Just disable your antivirus and it should work.
Thanks to #Marco Del Toro's answer, using easy_install worked for me: I could install the packages I needed for my project. I also managed to fix pip using easy_install so pip also works for me now. The solution to fixing pip was: easy_install pip.
This answer was posted as an edit to the question Pip not working on windows 10, freezes command promt by the OP Olof H under CC BY-SA 3.0.
If you have a certain network it can block pip for installation. For my case I used my own network without VPN.