trying to install xlrd in specific directory - python-3.x

I'm trying to pip install install xlrd to my local directory. First, I opened the anaconda prompt and tried this
pip install xlrd
No problems there. Then I try this
pip install xlrd -t <my windows path>
But it spits out an error:
Could not find a version that satisfies the requirement Code (from versions: )
No matching distribution found for Code
What's the issue here and how do I resolve this?

Ok this may seem like a stupid answer but it might help some people. My windows path had folder names with spaces. I removed them and it works.

Related

Spyder, clean Win installation, ver. 4.2.3 - pip gives message "No module named pip"

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.

PIP3 | WARNING: Could not generate requirement for distribution -ertifi 2019.11.28

I recently uninstalled all pip3 the pip3 packages installed in my local system.
Now, whenever I type pip3 freeze, this warning pops up:
WARNING: Could not generate requirement for distribution -ertifi 2019.11.28
(/usr/local/lib/python3.7/site-packages): Parse error at "'-ertifi='": Expected W:(abcd...)
How do I get rid of this warning.
I tried doing brew reinstall python3 as this would reinstall python3 along with pip3 but it doesn't seem to work.
Please help me figure this out.
I got into similar problem after I have upgraded my pip under windows from version 20.1.1 to version 20.2.3
It turned out that old version of pip was renaming folders that it could not delete, replacing first letter with tilda ~
The new version of pip counts this tilda as hyphen - I don't know why
So I was getting that same error but for a different package:
WARNING: Could not generate requirement for distribution -niso8601 8.0.0 (...) venv/lib/python3.6/site-packages): Parse error at "'-niso860'": Expected W:(abcd...)
It turned out to be a missing letter in my first package! I needed to have "aniso8601==7.0.0" I literally did a freeze from a different venv that had that same package I needed, copied and pasted into the requirements.txt in the new project's folder. The requirements.txt file in the new project then installed successfully.
TL;DR: My requirements.txt file had a typo.

how to do pip install manually

i'm trying to run this code
pip install pandas
from my company laptop, but i think to have a firewall block.
getting this error:
Could not find a version that satisfies the requirement pandas (from versions: ) No matching distribution found for pandas
I can't modify the firewall settings (in order to fix my problem) and i'm guessing if there is alternative way to download & install all libraries into python3.
Could i dowload the library and then paste it into a folder?
PS. i'm using pycharm
Thank you
Download appropriate file matching your Python version and architecture from https://pypi.org and then install it locally with pip, i.e.:
$ pip install --user pandas-0.25.1-cp36-cp36m-manylinux1_x86_64.whl
Processing ./pandas-0.25.1-cp36-cp36m-manylinux1_x86_64.whl
...
Note that the package might require further dependencies, so you might need to repeat for different packages.
If your machine requires a proxy, add this bit after install:
--proxy=http://sub_domain_proxy.sub_domain.domain:port

Installing Python Packages From local File System

I am trying to install some of the packages (Example: openpyxl) from local file system, however pip installer is always looking package from pypi.org or pypi.python.org and not from the local path.
Below are the commands, I have used.
pip install openpyxl c:\users\test\openpyxl-2.6.3.tar.gz
easy_install openpyxl c:\users\test\openpyxl-2.6.3.tar.gz
After the above commands are executed:I get the below errors:
Searching for openpyxl
Reading https://pypi.python.org/simple/openpyxl/
Download error on https://pypi.python.org/simple/openpyxl/
Installer pointing to pypi.python.org and not the local filesystem.
Encountered in:
Operating System: Windows 10
Python Version: 3.7
Pip Version:10.0.1
Thanks in advance for your help!
your command
pip install openpyxl c:\users\test\openpyxl-2.6.3.tar.gz
should be
pip install c:\users\test\openpyxl-2.6.3.tar.gz
as pip install accepts local paths to .tar.gz files directly.
Note that your pip is also quite outdated. You might want to consider upgrading it to the newest version

Pip on only installs to python27 while i need it to install on python37

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>

Resources