pip install treq failing - python

According to http://treq.readthedocs.org/en/latest/, treq can be installed using pip, however it is failing. I can install treq using the tar file, but I am wondering why this is failing since http://pypi.python.org/simple/treq/ has 0.1.0 and 0.2.0.
$ sudo pip install treq
Downloading/unpacking treq
Cannot fetch index base URL http://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement treq
No distributions at all found for treq
Storing complete log in <cut>.pip/pip.log
$ pip search treq
megrok.strictrequire - Checks that all grokked "view-like" components
require a permission.
streql - Constant-time string comparison
trequests - A Tornado async HTTP/HTTPS client adaptor for
python-requests
treq - A requests-like API built on top of twisted.web's
Agent
repoze.bfg.restrequest - a REST aware Request for implementing RESTful
applications with repoze.bfg
$
Just tried to install from tarfile and it can't find twisted either so wondering if there's basic issue with pip...
$ sudo python setup.py install
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
<snip>
Extracting treq-0.2.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding treq 0.2.0 to easy-install.pth file
Installed /usr/local/lib/python2.7/dist-packages/treq-0.2.0-py2.7.egg
Processing dependencies for treq==0.2.0
Searching for Twisted>=12.1.0
Reading http://pypi.python.org/simple/Twisted/
Download error on http://pypi.python.org/simple/Twisted/: timed out -- Some packages may not be found!
Reading http://pypi.python.org/simple/Twisted/
Download error on http://pypi.python.org/simple/Twisted/: timed out -- Some packages may not be found!
Couldn't find index page for 'Twisted' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Download error on http://pypi.python.org/simple/: timed out -- Some packages may not be found!
No local packages or download links found for Twisted>=12.1.0
error: Could not find suitable distribution for Requirement.parse('Twisted>=12.1.0')
$

The error message reads:
Download error on http://pypi.python.org/simple/Twisted/: timed out -- Some packages may not be found!
Did you check for a firewall blocking access to PyPI?

Related

RHEL 8 - Unable to complete pyPDF2 offline installation due to typing_extensions

I've been stuck with this problem.
I work on a UNIX RHEL8 server which did not allow to access internet.
All required packages and modules I able to install expect this pyPDF2 module due to typing_extensions
RHEL8 Python 3.6.8
Pip 9.0.3 installed but not able to use due to no internet access
PyPDF2 2.10.0 try to install using python setup.py build && python setup.py install
Installed /usr/local/lib/python3.6/site-packages/PyPDF2-2.10.0-py3.6.egg
Processing dependencies for PyPDF2==2.10.0
Searching for typing_extensions
Reading https://pypi.org/simple/typing_extensions/
Download error on https://pypi.org/simple/typing_extensions/: [Errno -2] Name or service not known -- Some packages may not be found!
Reading https://pypi.org/simple/typing-extensions/
Download error on https://pypi.org/simple/typing-extensions/: [Errno -2] Name or service not known -- Some packages may not be found!
Couldnt find index page for 'typing_extensions' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.org/simple/
Download error on https://pypi.org/simple/: [Errno -2] Name or service not known -- Some packages may not be found!
No local packages or working download links found for typing_extensions
pip install method unable to be use due to no internet access
Please help me. Thank you
You need to install the package:
pip install typing-extensions
In newer Python versions that package is not required.
You can also edit the source of PyPDF2 to remove all imports of it and Literal.
You can download whl file from https://pypi.org/ for the package.
And if pip is installed it can be easily installed using :
pip install wheel_file.whl

install numpy and pandas on 1and1 shared hosting python

I've installed python 2.7.14 on my 1and1 shared hosting server using the following tutorial: http://geeksta.net/geeklog/python-shared-hosting/
it works and has a bunch of the modules that I use. However, i'd like to have numpy and pandas on this installation as well.
I'm having all sorts of issues, but the most basic one is when typing:
pip install numpy
which leads to the following error:
Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy
So it looks like maybe it's failing because I don't have SSL installed, but all the suggestions for installing SSL seems to require sudo (which I can't access root on a shared host).
A second question is that I'm wondering about is if I need to use a virtualenv or not. I'm new to this but it seems like it will allow me to install things, but again I tried to install virtualenv (as stated in the tutorial):
pip install virtualenvwrapper
but I get the same sort of SSL error:
Could not fetch URL https://pypi.python.org/simple/virtualenvwrapper/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement virtualenvwrapper (from versions: )
No matching distribution found for virtualenvwrapper
any help that can direct me in the right direction to get these modules installed would be greatly appreciated. Thanks.
Updated to ask additional approach Given the issue seems to be not being able to download a python package on a https site (b/c SSL isn't available), is it possible for me to download the package manually using my webbrowser then FTPing the file into my server filesystem and then using SSH commands to install the modules? If so, any tips would be much appreciated.
Okay, I finally figured it out. Basically, downloading each package manually from their various websites and ftp-ing them to the shared host and then unzipping and installing them manually is what worked for me. This avoids having to connect to an SSL site to download the file on the shared host.
for numpy:
I downloaded the source file (numpy-1.14.2.zip) for numpy from here: https://pypi.org/project/numpy/#files
FTP that to the python folder in my shared host.
unzipped it
unzip numpy-1.14.2.zip
then ran setup.py from inside the numpy-1.14.2 folder
python setup.py install
Then I repeated this for pandas and it's dependencies:
setuptools
NumPy: 1.9.0 or higher
python-dateutil: 1.5 or higher
pytz: Needed for time zone support

`setup.py test` cannot find package in own repo

I'm trying to run tests with my setup.py as usually with python setup.py test with appropriate setup.py configuration. It was ok until I added a package from my own repository.
I can easily install it with pip install my_package, having the --extra-index-url in /etc/pip.conf or credentials in ~/.pypirc. I also entered the url in dependency_links in the setup.py file!
But when I run it now, I see it knows about the module, but it is unable to download it!
(testpy3) honza#mycomp:~/.../xxxx_module$ python setup.py test
running pytest
Searching for package_yyyy
Reading https://specimen:specimen#repo.xxxxx.net/repository/pypi-private/simple
Reading https://pypi.python.org/simple/package_yyyy/
Reading https://pypi.python.org/simple/package_yyyy-grpc/
Couldn't find index page for 'package_yyyy' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or working download links found for package_yyyy
error: Could not find suitable distribution for Requirement.parse('package_yyyy')
In fact I want to use this in docker, but does not work locally nor in docker. Any ideas, please?

Installing MySQL-python with easy-install failed

I'm struggling with installing MySQL-python on my Centos VPS. I have "main" Python 2.6 (one that came automatically with CentOS) and another one I installed after (2.7). So I used this command:
easy_install-2.7 MySQL-python
But it reproduces following error:
Searching for MySQL-python
Reading https://pypi.python.org/simple/MySQL-python/
Download error on https://pypi.python.org/simple/MySQL-python/: unknown url type: https -- Some packages may not be found!
Couldn't find index page for 'MySQL-python' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: unknown url type: https -- Some packages may not be found!
No local packages or download links found for MySQL-python
error: Could not find suitable distribution for Requirement.parse('MySQL-python')
Thanks for reading my question and possibly trying to help!
Perhaps you're using an old version of easy_install, that may be the root of problem. You can follow instructions from distribute doc package, and than install pip. Since you have installed pip you can install MySQL-pythoneasily.
Maybe try use some sentence,which include mysqldb.

Using pip and easy_install in virtualenv on Windows

I was trying to install a few packages in a virtual environment using pip. I was getting the error:
Downloading/unpacking pymongo
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pymongo
No distributions at all found for pymongo
I found that some say a workaround is downgrading your pip. I downloaded and installed pip 1.2.1 Now I get the error:
(env1)PS C:\dev\virtualenvs> pip install bottle
Downloading/unpacking bottle
Cannot fetch index base URL http://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement bottle
No distributions at all found for bottle
The log says:
urlopen error [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions>
How do I correctly use virtualenvs on windows?
EDIT: I am able to use pip when not in my virtualenv.
In this case the operating system should not matter. Also this should not be a question about virtualenv (as suggested in your title). pip just cannot access the remote end that it would like to access. Does it take some time for the error message to appear (is this a timeout issue)? If yes, then this is a networking issue, maybe triggered by a firewall. You should check this first.

Categories