1

I have several packages in folder Top. The path is set at the command prompt such that each package contains some python files that use other packages' modules.

I have the following files in Top directory: setup.py, MANIFEST, MANIFEST.in, README. I wish to modify the setup files such that the path is set during installation. Does PYTHONPATH set it, and does it need to go into a new file?

1 Answer 1

1

The appropriate actions here are

  • Packages do not mess with PYTHONPATH. Never.

  • Instead, you write an setup.py entry point to your command line scripts

  • When the user installs the package using pip install the command line script is automatically added to user's PATH, which is hopefully inside virtualenv

  • This command line script is generated during the install, so that it points to the PYTHONPATH of virtualenv or system-wide Python installation. The path is hardcoded at the script head, pointing to the current Python interpreter.

More info

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.