I installed anaconda and installed various modules in it. Later I uninstalled it but when I try to install packages in Python through command line, it says requirements already satisfied and doesn't install. I want to install modules in simple Python now not in anaconda. How to fix it? Also, if I have uninstalled anaconda, why do I get the requirements satisfied message?
I am not very clear what you are trying to achieve , but you can always install the packages in a new location , and point the Python script to the new locations.
Python -m pip install --target="New location" [package name]
Related
I want to import tensorflow_docs in a PyCharm python file. The I've installed it by
pip install git+https://github.com/tensorflow/docs
In PyCharm, the interpreter's install window does not contain tensorflow_docs as a package. I tried
conda install git+https://github.com/tensorflow/docs
At first, attempting to install tensorflow_docs gave the readout:
"Requirement already installed in anaconda/..."
I uninstalled with pip and reinstalled from github, but it still won't show up in PyCharm.
This may not be the exact solution and just an idea, but try creating a new environment so there is a fresh state to build on top.
I'm trying to install a package onto Pycharm using PIP. I am running Anacondas on a Pycharm IDE. I know that you use the project interpreter to install packages and I also know that the package should be located under PyPi but when I go to the project interpreter and click add package the package I'm trying to install doesn't appear under the list of available packages.
I know that you can install the package using PIP and I have PIP installed through Anaconda although I am unsure how to run a pip command through Pycharm. I've tried typing it into the cmd console and the python code and neither seems to have any effect...
The package I'm trying to install is: https://github.com/seatgeek/fuzzywuzzy.
The pip command to install it is: pip install fuzzywuzzy but I am unsure as to where I'm supposed to run that command.
I'm fairly new at Python so any help would be much appreciated!
Thank you!
I found someone else's answer that works for me:
You need to use
import pip
pip.main(['install','packagename'])
Which allows you to manually install packages through pip using Python code.
This is guide for installing the pip packages from Python Console in Pycharm IDE.
Do not forget to run Pycharm as administrator if you are using windows OS before installing the packages.
First of all import the pacakage of pip in python console.
import pip
Installation of Package.
pip.main(['install', '<package_name>'])
Examples
The below command will upgrade the version of package setuptools.
pip.main(['install','--upgrade','setuptools'])
The below command will install the scikit-learn and numpy packages.
pip.main(['install','numpy','scikit-learn'])
The below command will uninstall the scikit-learn package.
pip.main(['uninstall','scikit-learn'])
I was with the same problem, all i did was : Configure the project interpreter to the Python3 inside the venv you are using the pip install.
Remember to activate the venv.
That's it , now you can use the pip install on pycharm or on prompot.
The problem is that even with the "venv/lib/sitepackeges" in the your project's sys.path the pycharm looks only for the packages where the project interpreter is.
I recently updated from Python 3.5 to Python 3.6 and am trying to use packages that I had previously downloaded, but they are not working for the updated version of Python. When I try to use pip, I use the command "pip install selenium" and get the message "Requirement already satisfied: selenium in /Users/Jeff/anaconda/lib/python3.5/site-packages" How do I add packages to the new version of Python?
First, make sure that your packages do have compatibility with the version of Python you're looking to use.
Next, run pip freeze > requirements.txt in the base directory of your Python project. This puts everything in a readable file to re-install from. If you know of any packages that require a certain version that you'll want to re-install, put package==x.x.x (where package is the package name and x.x.x is the version number) in the list of packages to make sure it downloads the correct version.
Run pip uninstall -r requirements.txt -y to uninstall all packages. Afterwards, run pip install -r requirements.txt.
This allows you to keep packages at the correct version for the ones you assign a version number in requirements.txt, while upgrading all others.
I have some systemwide packages I've installed and I'm unclear whether I'm supposed to install another copy of them all for Python3 or if there is some way to 'point' Python3 at them. I'm on a Mac.
I still have Python 2.7.9 which has all the packages (most installed with either brew or pip and maybe one or two manually like pyqt). Do I basically have to redo the installation process for every single package again? Or is there some way to simply have Python3 'inherit' everything I've installed so far under 2.7.9?
Also, from what I understand, to install under Python3 with pip I would use pip3 install, is that correct? How would I do the same with ones installed with Homebrew? Is there a brew3 command? Or does Homebrew install to all versions of Python?
You do need to reinstall, but I would step away from systemwide installs in general and start using project-specific package installation.
Use pyenv for version switching and virtualenv for isolated environments.
pyvenv works rather well.
Install Python 3
python -m venv "my_virtual_env"
my_virtual_env\Scripts\activate
pip search lib
pip install ...
You will have to look up what the activate command is for osx. pip is the standard package manager now. You can search, install, and uninstall with pip. Pip is also moving towards wheels when installing packages. You probably don't have to worry about wheels too much though.
I am going through the Learn Python the Hard Way, 2nd Edition book, and I am stuck on this problem: "Use your setup.py to install your own module and make sure it works, then use pip to uninstall it."
If I type
setup.py install
in the command line, I can install the module.
But when I type
pip uninstall setup.py
it says:
Cannot uninstall requirement setup.py, not installed
The pip package index says, http://pypi.python.org/pypi/pip, says:
pip is able to uninstall most installed packages with pip uninstall package-name.
Known exceptions include pure-distutils packages installed with python setup.py install >(such packages leave behind no metadata allowing determination of what files were >installed)
Is there another way to install my module that pip will recognize?
By the way, I'm using a windows computer. Just wanted to mention that in case there are different solutions for Windows, Linux, and Mac.
You're giving pip a Python file and not a package name, so it doesn't know what to do. If you want pip to remove it, try providing the name of the package this setup.py file is actually part of.
There are some good suggestions in this related thread:
python setup.py uninstall