1

I installed a library through pip that only worked with Python2. I modified the source a bit to make it work with Python3, however I would like to repackage my modified version so that I can move it to another PC. How can I do it?

phd
  • 69,888
  • 11
  • 97
  • 133
Luca Giorgi
  • 830
  • 2
  • 11
  • 27

2 Answers2

2

See any of these references from the docs/stackoverflow:

The process essentially consists of:

  • creating the package through directory structure and __init__.py
  • using setuptools to specify project metadata
  • installing with pip
  • optionally uploading to PyPI with twine.
Dustin Ingram
  • 18,223
  • 4
  • 51
  • 70
pkfm
  • 443
  • 3
  • 7
0

Your package should have a setup.py that come with it

python3 setup.py bdist_wheel

This will create directory called dist containing a python wheel file

ls -l dist\*.whl

Copy that file to the other system and

pip3 install <file_name>.whl

William D. Irons
  • 1,984
  • 1
  • 17
  • 19
  • This assumes that the two platforms are the same, which might not be the case, and the install might fail. A source distribution (`python setup.py sdist`) would be guaranteed to work. – Dustin Ingram Jun 28 '19 at 17:19