0

I am fairly new to python so pardon my lack of jargon. I am trying to install the pulp module onto a work pc. I have downloaded the package from the pypi.org website into the program data folder on this pc.

I have tried:

pip install pulp
import pulp
python.exe -m pip install pulp

And this is the error that pops up every time.

pip install pulp
Collecting pulp
Note: you may need to restart the kernel to use updated packages.
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 authenticationrequired'))': /simple/pulp/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 authenticationrequired'))': /simple/pulp/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 authenticationrequired'))': /simple/pulp/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 authenticationrequired'))': /simple/pulp/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 authenticationrequired'))': /simple/pulp/
  ERROR: Could not find a version that satisfies the requirement pulp (from versions: none)
ERROR: No matching distribution found for pulp

I just would like to get pulp installed so that I can access the functions that come with it.

Dom
  • 55
  • 8

3 Answers3

1

You need to tell pip about your proxy to use it that way. Something like this:

pip install --proxy http://user:password@host:port pulp

You may have to ask IT about the details.

Alternatively tell pip to install the file you downloaded:

pip install /path/to/downloaded/file

But you might find problems if it requires other packages and your internet connection is not working.

Stop harming Monica
  • 12,141
  • 1
  • 36
  • 56
  • I ran command prompt as admin and am now running into this error. Any thoughts? `Could not find a version that satisfies the requirement pulp (from versions: ) No matching distribution found for pulp` – Dom Oct 01 '19 at 16:36
  • @DominicMonsivais That looks like the same error as before and I don't know what you ran exactly. And you accepted the answer but now you say it is not working. So I don't know what you did, I am not sure what happened when you did and I don't know how to help you. – Stop harming Monica Oct 01 '19 at 17:16
1

This ultimately may be a duplicate of the following, assuming local install: python-pip-install-from-local-dir and installing-python-packages-from-local-file-system-folder-to-virtualenv-with-pip

However, to answer in general, when you want to install a python module, you have a few options. The simple approach is generally to use pip (pip2 for explicit python2, pip3 for explicit python3) which automatically tries to download the module from the python module repositories.

As Goyo points out in their answer, you need to have access to the Internet for that to happen, and as such must specify settings to work through your proxy.

If, however, you have downloaded the module onto your computer already, you can also use it directly, in two ways.

Firstly, as per python-pip-install-from-local-dir, you can specify a package to install.

If you want a quick use, without pip involved (custom package, out of date, etc.), you can also locate your site packages folder with:

python -m site --user-site

Running without --user-site will also show the root site for your distro.

Extract your module and copy it into the user site folder, eg. for python3 "~/.local/lib/python3.4/site-packages". I create sym-links for python, python3 etc. to point to a generic python-site-packages directory, to help different versions locate the correct spot:

lrwxrwxrwx python -> /home/user/.local/lib/python-site-packages
lrwxrwxrwx python2 -> /home/user/.local/lib/python-site-packages
lrwxrwxrwx python2.7 -> /home/user/.local/lib/python-site-packages
lrwxrwxrwx python3 -> /home/user/.local/lib/python-site-packages
lrwxrwxrwx python3.4 -> /home/user/.local/lib/python-site-packages
drwxrwxr-x python-site-packages

Then you can include the module in your python code. However, having bypassed pip means that you won't necessarily have the latest module, and other modules will not know that the requirement has been met.

To check officially installed modules:

pydoc -g (python2)
pydoc3 -b (python3)
sarlacii
  • 454
  • 7
  • 14
0

I presume that you are using a Windows machine.

Choose the Run as administrator option when you open cmd and just type pip, in order to ensure that your pip is working perfectly.

If you encounter no errors, then type pip install pulp and the module will be downloaded.

Simply import the module as import pulp

If your pip is working perfectly, then you should get a similar message.

Ishaan Ohri
  • 187
  • 1
  • 2
  • 9