Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assistance with custom installation directory #48

Open
JKing2000 opened this issue Jun 26, 2023 · 5 comments
Open

Assistance with custom installation directory #48

JKing2000 opened this issue Jun 26, 2023 · 5 comments

Comments

@JKing2000
Copy link

JKing2000 commented Jun 26, 2023

Hi, I am looking into installing TEsorter into a custom shared python directory. I tried using:
python setup.py install --prefix=$(NEW_PATH)

and this created the following:
${NEW_PATH}/bin/* (containing the TEsorter and the .py scripts)
${NEW_PATH}/lib/python3.9/site-packages/TEsorter-1.4.6-py3.9.egg/*

But when I run TEsorter with the following command, the following error occurred
${NEW_PATH}/bin/TEsorter

Traceback (most recent call last):
File "/home/561/jc4878/test5/bin/TEsorter", line 33, in
sys.exit(load_entry_point('TEsorter==1.4.6', 'console_scripts', 'TEsorter')())
File "/home/561/jc4878/test5/bin/TEsorter", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
File "/apps/python3/3.9.2/lib/python3.9/importlib/metadata.py", line 524, in distribution
return Distribution.from_name(distribution_name)
File "/apps/python3/3.9.2/lib/python3.9/importlib/metadata.py", line 187, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: TEsorter

It seems to only work when it is installed in the --user default location, which is not ideal.
python setup.py install --user

usage: TEsorter [-h] [-v] [-db {gydb,rexdb,rexdb-plant,rexdb-metazoa,rexdb-pnas,rexdb-line,sine}] [--db-hmm DB_HMM] [-st {nucl,prot}] [-pre PREFIX] [-fw] [-p PROCESSORS] [-tmp TMP_DIR]
[-cov MIN_COVERAGE] [-eval MAX_EVALUE] [-prob MIN_PROBABILITY] [-nocln] [-cite] [-dp2] [-rule PASS2_RULE] [-nolib] [-norc] [-genome] [-win_size WIN_SIZE]
[-win_ovl WIN_OVL]
sequence
TEsorter: error: the following arguments are required: sequence

@zhangrengang
Copy link
Owner

Maybe the PYTHONPATH is not set properly. Do you have added "${NEW_PATH}/lib/python3.9/site-packages/" to PYTHONPATH?

@JKing2000
Copy link
Author

yes I do have "${NEW_PATH}/lib/python3.9/site-packages/" in my PYTHONPATH

@JKing2000
Copy link
Author

I think I may have figured it out.
It works when I append "${NEW_PATH}/lib/python3.9/site-packages/TEsorter-1.4.6-py3.9.egg/" to PYTHONPATH. which is a bit annoying since my python module only prepend "${NEW_PATH}/lib/python3.9/site-packages/" into PYTHONPATH when it is loaded.
the TEsorter-1.4.6-py3.9.egg folder contains two sub directories that comes with the installation, EGG-INFO and TEsorter.

@zhangrengang
Copy link
Owner

Does ${NEW_PATH}/lib/python3.9/site-packages/ contain *.pth files like easy-install.pth? Normally, TEsorter-1.4.6-py3.9.egg/ should be in the pth file.

@JKing2000
Copy link
Author

No it does not have any .pth file in the TEsorter-1.4.6-py3.9.egg/ folder when using --prefix,
But when using --user, it has a "easy-install.pth" file which contains one line:
./TEsorter-1.4.6-py3.9.egg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants