ERROR: You must give at least one requirement to install - CDSW - python

I am trying to install packages on my cdsw environment.
I have placed the packages in my cd /home/ folder
and I am running below command:
pip install --no-index --find-links=/home/cdsw/Package/scipy-1.7.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
I get below error:
ERROR: You must give at least one requirement to install (maybe you meant "pip install /home/cdsw/Package/scipy-1.7.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl"?)
Linux version:
4.4
Python 2: Python 2.7.11
Python 3: Python 3.6.1
Java: openjdk version "1.8.0_211"
How do I resolve this problem.

Currently, you are only passing information to pip of where you want to find the package but not what package to install. find-links is used to pass a location of where your package will be located (and not the package).
To successfully installl you can use:
pip install --no-index /home/cdsw/Package/scipy-1.7.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Edit 1:
Based on your comments, you also do not have the whl downloaded. So, you can also simply install scipy using the command:
pip install scipy
or can download a specific whl file from scipy's github
Edit 2:
Since you still are running into the error, and have 2 python versions installed, the pip command might be associated with python2.7. In that case, it is likely that python3 is the command associated to the python3 installation and python is the command associated to the python2 installation. Using the command in the format below will install scipy correctly.
python3 -m pip install --no-index /home/cdsw/Package/scipy-1.7.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Edit 3:
You have python 3.6.1 installed on your machine, which is not supported by scipy v1.7.1. You have 2 options to fix this issue:
Upgrade to a newer version of python
Install a version of scipy which has python 3.6 support. I looked into the same and found v1.5.4 as the last version with support for python 3.6 support. You can download the whl for the same here.
Make sure you are downloading the file containing a file with cp36 in it, since those will be the files compatible with python 3.6

Related

Trouble installing packages in Python - ... is in an unsupported or invalid wheel

Hi I am trying to install win10toast and I get this message:
I had this error when I tried to download pywin32 previously, but why is this error popping up whenever I try to install any other package? I used to be able to install packages fine before with the same command
pywin32 is listed as a requirement for the package win10toast (link). So, when you are installing win10toast, pip also tries to install pywin32 which gives you an error.
From the looks of it, you are using a python 3.6 and a 32-bit system, both of which are supported by the latest release (pywin32 302). To resolve the pywin32 error, you could try the following.
Option 1: Considering there are multiple installs and python3 is mapped to python 3.6 installation. (You can check that using python --version)
Install using python -m pip install pypiwin32
If you had a prior successful install on pypiwin32, you could actually try to use: python Scripts/pywin32_postinstall.py -install
Option 2: Download the binary files and install - https://github.com/mhammond/pywin32/releases/tag/b302
Download the appropriate exe and install
Option 3: Download the source files and build:
Download the zip file from: https://github.com/mhammond/pywin32/releases/tag/b302
Unzip the file
Use the command python setup.py install
Update:
I was looking around the pywin32 github repo and found that the same issue is encountered by others too. While an official update is not rolled out, you can try the solution there:
you need to download the wheel found here
Install the whl manually using the command: python -m pip install C:/some-dir/pywin32-302.1-cp36-cp36m-win32.whl

Installing scikit-learn with pip: are there multiple python versions installed on my computer?

I'm trying to install scikit-learn with pip by using pip install scikit-learn
and I got this message:
DEPRECATION: Python 2.7 reached the end of its life on January 1st,
2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021.
More details about Python 2 support in pip can be found at
https://pip.pypa.io/en/latest/development/release-process/#python-2-support
pip 21.0 will remove support for this functionality.
WARNING: The scripts f2py, f2py2 and f2py2.7 are installed in '/Users/my_name/Library/Python/2.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
However, when I type python --version it says that my version is 3.7.4. Are python 2.7 and 3.7 both installed on my computer then? If so, is there a way I can get rid of 2.7? Also, I still get a ModuleNotFoundError when I do from sklearn.cluster import MeanShift in the mu_editor. I think it's because pip is installing the modules to the python 2.7 directory or something, instead of the python 3.7.4 directory that the mu_editor is connected to. Is there any way I can install the packages to the python 3.7.4 directory instead of the 2.7 one?
First, use python -v to check default python installation. If it is the version you are using, continue with python instead of python3.
Now run python3 -m pip install scikit-learn
If you are on a Mac, DO NOT DELETE PYTHON 2.7. It is needed for your system to run properly.
plz use this command
pip install -U scikit-learn
In order to check your installation you can use
python -m pip show scikit-learn # to see which version and where scikit-learn is installed
python -m pip freeze # to see all packages installed in the active virtualenv
python -c "import sklearn; sklearn.show_versions()"
see https://scikit-learn.org/stable/install.html

How to download matplotlib for python 3.7 in windows 8?

How do you download matplotlib to windows so I can use it with python?
Every other question related to this that I've found on StackOverflow has led to the same problem which is that it keeps giving me the error:
python setup.py egg_info failed with error code 1 in C:\Users\Myname\AppData\Local\Temp\pip-install-9gc765gs\matplotlib\
Things I have tried (from the command prompt):
pip install matplotlib
pip install matplotlib-1.5.0-cp35-none-win_amd64.whl (which is the file I downloaded from SourceForge and is now stored in my computer)
pip install "matplotlib-1.5.0-cp35-none-win_amd64.whl"
python -mpip install -U matplotlib
I even tried tried:
pip install --upgrade setuptools
python -mpip install -U pip
prior to using the other commands to make sure everything was up to date.
Any help would be very appreciated.
Matplotlib has not been officially released for Python 3.7 yet.
As of this writing, a 3.7 version for Mac and Linux has been uploaded to PyPI earlier today, which means the Windows versions are probably coming very soon. pip will probably work after that.
Similarly, no 3.7 compatible versions have been put onto conda-forge or integrated into the main conda repo yet. I'm sure those will be coming in the next couple of weeks.
Until then, maybe installing from source will work?

How to install Python packages for version 3.6 on Mac [duplicate]

This question already has an answer here:
How to install pip on python 3.6, not the default python 2.7?
(1 answer)
Closed 4 years ago.
Okay, so I have the following issue. I have a Mac, so the the default Python 2.7 is installed for the OS's use. However, I also have Python 3.6 installed, and I want to install a package using Pip that is only compatible with python version 3. How can I install a package with Python 3 and not 2?
To download use
pip3 install package
and to run the file
python3 file.py
Why do you ask such a thing here?
https://docs.python.org/3/using/mac.html
4.3. Installing Additional Python Packages
There are several methods to install additional Python packages:
Packages can be installed via the standard Python distutils mode (python setup.py install).
Many packages can also be installed via the setuptools extension or pip wrapper, see https://pip.pypa.io/.
https://pip.pypa.io/en/stable/user_guide/#installing-packages
Installing Packages
pip supports installing from PyPI, version control, local projects, and directly from distribution files.
The most common scenario is to install from PyPI using Requirement Specifiers
$ pip install SomePackage # latest version
$ pip install SomePackage==1.0.4 # specific version
$ pip install 'SomePackage>=1.0.4' # minimum version
For more information and examples, see the pip install reference.
Just a suggestion, before you run any command that you don't know what is it, please use which your_cmd or whereis your_cmd to find its path.

How can I let pip know that I am interested in packages for python 3.4?

After an hour search, I have found no answer.
My Mac came with Python 2.7, but I have decided to upgrade to python 3.4.
I installed python 3.4 from python.org.
I can now use python 3.4 from terminal.
Pip still tries to download python 2.7 packages - numpy for 2.7 is "up to date".
When I try to --upgrade a package, for example numpy, I get "no permission" error. With sudo appended, the output is trash.
How can I let pip know that I am interested in packages for python 3.4?
Requirement already up-to-date: numpy in /Library/Python/2.7/site-packages
That's the problem. I want numpy to be up-to-date with Python 3.4.
You should be able to call a specific pip for your install, although it depends on which version you are running:
Starting at version 0.8:
pip-3.4 install numpy
and starting at version 1.5:
pip3.4 install numpy
If you don't have these, you should be able to just download pip and reinstall it, just be sure to call python 3.4 when you run the installer.
I would suggest to install a package manager such as macports brew and install the updated python version from them. After the latest version of python is setup use pip to install the version of numpy
In mac ports , you are able to select the default system python without messing with the path your self.
I would use Homebrew:
brew install python3
This should install Python3.4.1. Then to get pip:
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python3 get-pip.py
# Upgrade just in case...
pip3 install -U pip
Then use:
pip3 install numpy
And to run Python, use:
python3
(I only have one Python 3 installation, if you have multiple you'll need to be more specific with the version number)

Categories