0

In maven, if I call mvn install it packages all files into local repository and I can refer them from another projects.

How to do this with python?

I have created my project, one subdirectory with modules and __init__.py inside, then have created setup.py at root level and ran it with

$ python setup.py install
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/poseutils
copying poseutils/vizualisation.py -> build/lib/poseutils
copying poseutils/linalg.py -> build/lib/poseutils
copying poseutils/util.py -> build/lib/poseutils
copying poseutils/__init__.py -> build/lib/poseutils
copying poseutils/config.py -> build/lib/poseutils
copying poseutils/data.py -> build/lib/poseutils
copying poseutils/report.py -> build/lib/poseutils
copying poseutils/skeleton.py -> build/lib/poseutils
copying poseutils/matlab.py -> build/lib/poseutils

I have an impression, that it just copied all files into build subdirectory of the same project. How can I use this from another projects? I neede it to put at somewhere in machine-wide place!

How to do that?

UPDATE

My setup.py is following:

from distutils.core import setup

setup(name='Poseutils',
      version='1.0dev',
      description='my description',
      author='myname',
      author_email='my@email',
      packages=['poseutils'],
     )

UPDATE 2

I had wrong statement of packages=['poseutils, poseutils.demo'] and I had no demo package. It was reporting error, but I was thinkink it is irrelevent and not typed it here. Although, this error was interrupting install task and files were not copied to destination.

Dims
  • 47,675
  • 117
  • 331
  • 600
  • Yes it will copy all py files to build/ directory along with egg file generation and now that package can be used in that project e.g. `import poseutils, lib`. However, to use it in whole system you need to update disutils or provide this package in python path or dirty solution to copy it in system disutils. You can [refer](https://stackoverflow.com/questions/17236675/how-to-make-my-python-module-available-system-wide-on-linux) which is similar – Mahesh Karia Oct 27 '17 at 06:58
  • @MaheshKaria I was using `distutils` namely. See my update. – Dims Oct 27 '17 at 08:52
  • 1
    1. try `sudo python setup.py install`. 2. try `sudo pip install .` – Aleksandr Borisov Oct 27 '17 at 09:15

0 Answers0