Hopefully you have had time to download everything and have sitting nicely in a directory. I say hopefully as it was 180gb when I downloaded it and I know that not everyone has a fast connection.
As a note, anything done from this point is done inside of a virtual environment. If you haven't used virtual environments and are not familiar with them, I highly suggest you read about them as they have worthy benefits.
Now that you have your mirror created you need to put it to good use. To do this there are a couple of things you need to do:
- install a module for running a pypi server
- edit the appropriate config file(s) to point to the new repo
- start the pypi server
- install a module while configured to point to your new repo
$ pip install pypiserver
Once the server is installed, you will want to start it with the following command:
$ pypi-server -p 7777 ~/pypi/packages
That will start the server on: http://localhost:7777/
You now need to make some config changes. At a minimum you need to change
~/.pip/pip.conf
You will want to mofify 'index-url' in the 'global' section of the config file to point to 'http://localhost:7777/'. (I do suggest you remember where your config file was pointing to before you change it. Its always a good idea to make a backup copy of the config file before you make your edits).
Now that you have that configured things and have the server running, its time to turn off your internet connection and do a 'pip install' of a module and see if it works.
No comments:
Post a Comment