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

How to install two different versions of s2p? #55

Closed
lionlai1989 opened this issue Jun 23, 2020 · 3 comments
Closed

How to install two different versions of s2p? #55

lionlai1989 opened this issue Jun 23, 2020 · 3 comments

Comments

@lionlai1989
Copy link
Contributor

Hi:
Is it possible to install two different versions of s2p on my laptop?
My laptop now has MISS3D/s2p.https://github.com/MISS3D/s2p
But I want to try cmla/s2p without uninstall the MISS3D/s2p.
I first rename /usr/local/bin/s2p to /usr/local/bin/s2p_old, then I download the cmla/s2p. After, I modified the name entry in setup.py (cmla/s2p) to s2p-new and version entry, but it doesn't work out.
Any suggestion will be appreciated. Thank you very much.

@carlodef
Copy link
Member

Hi @lionlai1989, a possible way of doing that would be to use virtual environments: https://docs.python.org/3/tutorial/venv.html

@lionlai1989
Copy link
Contributor Author

lionlai1989 commented Jun 24, 2020

Hi @carlodef Could you please explain more how to do it? I tried, but could not succeed. My steps are the following.

  1. Create s2p_venv.
  2. cd s2p_venv and activate s2p_venv.
  3. Download cmla/s2p to s2p_venv.
  4. cd cmla/s2p and execute pip install -e .
  5. But it still run the old s2p instead of the new one. However, it run the s2p in the venv /home/ubuntu/venv_cmla_s2p/bin/s2p.
    I modified the cli.py to see which s2p it executes.
    I think now the question is when the shell run s2p, how does it know which cli.py it should execute. If I can redirect that to a new cli.py, does it mean that it run the new s2p instead of the old one.

@carlodef
Copy link
Member

Hi @lionlai1989, I don't understand your step 2: you don't need to cd to a specific directory in order to activate a virtual environment.

When you activate an environment, you can check which version of python, pip and s2p are used by using the command which. For example:

which python

should give different results in different virtual environments

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