Open shadiakiki1986 opened 7 years ago
Thanks for the detailed bug report :)
Unfortunately, I'm not sure if I'll be able to take a look at it... The next 2 weeks are a bit packed
Sent from mobile. Please excuse my brevity.
On 16 Feb 2017 6:27 am, "Shadi Akiki" notifications@github.com wrote:
Hello. Thank you for bringing pew into this world :)
I'm on pew version 0.1.26
I created an environment BLOTTER_FINANCE with it, ran a few pip install, then I did pew rename BLOTTER_FINANCE DJANGO_ZIPLINE, but then the following happened:
pew workon DJANGO_ZIPLINE Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.> pip --version bash: /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/pip: /home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3: bad interpreter: No such file or directory> pip3 --version bash: /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/pip3: /home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3: bad interpreter: No such file or directory
eventhough the following works
pew in DJANGO_ZIPLINE pip --version pip 9.0.1 from /home/ubuntu/.local/lib/python2.7/site-packages (python 2.7)> pew in DJANGO_ZIPLINE pip3 --version pip 9.0.1 from /home/ubuntu/.local/lib/python3.5/site-packages (python 3.5)
So I checked all the updated references after the rename with a grep:
grep ZIPLINE /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/* /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/activate:VIRTUAL_ENV="/home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE" /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/activate.csh:setenv VIRTUAL_ENV "/home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE" /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/activate.fish:set -gx VIRTUAL_ENV "/home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE" grep: /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/pycache: Is a directory /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/python-config:#!/home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/python
And grep'd for the references that are still pointing at the old name
grep BLOTTER /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/* /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/alembic:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/cygdb:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/cython:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/cythonize:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/django-admin:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/django-admin.py:#!/home/ubuntu/.local/share/virtualenvs BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/easy_install:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/easy_install-3.5:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/f2py:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/mako-render:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/pbr:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/pip:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/pip3:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/pip3.5:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 grep: /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/pycache: Is a directory /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/wheel:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3 /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/zipline:#!/home/ubuntu/.local/share/virtualenvs/BLOTTER_FINANCE/bin/python3
Then I used the following sed commands:
sed -i "s/BLOTTER_FINANCE/DJANGO_ZIPLINE/g" /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/*.py> sed -i "s/BLOTTER_FINANCE/DJANGO_ZIPLINE/g" /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/wheel> sed -i "s/BLOTTER_FINANCE/DJANGO_ZIPLINE/g" /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/bin/zipline
and now it works:
pew in DJANGO_ZIPLINE pip --version pip 9.0.1 from /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/lib/python3.5/site-packages (python 3.5)> pew workon DJANGO_ZIPLINE Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.> pip --version pip 9.0.1 from /home/ubuntu/.local/share/virtualenvs/DJANGO_ZIPLINE/lib/python3.5/site-packages (python 3.5)
Also, notice how now the pew in DJANGO_ZIPLINE pip --version uses python3.5 folder instead of python2.7.
Finally, here is a short and complete sequence of commands that can recreate this issue
pew new ENV_A Using base prefix '/usr' New python executable in /home/ubuntu/.local/share/virtualenvs/ENV_A/bin/python3 Also creating executable in /home/ubuntu/.local/share/virtualenvs/ENV_A/bin/python Installing setuptools, pip, wheel...done. Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.> pip --version pip 9.0.1 from /home/ubuntu/.local/share/virtualenvs/ENV_A/lib/python3.5/site-packages (python 3.5)> exitexit> pew rename ENV_A ENV_B Copying /home/ubuntu/.local/share/virtualenvs/ENV_A in ENV_B> pew in ENV_B pip --version pip 9.0.1 from /home/ubuntu/.local/lib/python2.7/site-packages (python 2.7)> pew workon ENV_B Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.> pip --version bash: /home/ubuntu/.local/share/virtualenvs/ENV_B/bin/pip: /home/ubuntu/.local/share/virtualenvs/ENV_A/bin/python3: bad interpreter: No such file or directory> exit> grep -r ENV_A /home/ubuntu/.local/share/virtualenvs/ENV_B/bin/ /home/ubuntu/.local/share/virtualenvs/ENV_B/bin/pip3.5:#!/home/ubuntu/.local/share/virtualenvs/ENV_A/bin/python3 /home/ubuntu/.local/share/virtualenvs/ENV_B/bin/pip3:#!/home/ubuntu/.local/share/virtualenvs/ENV_A/bin/python3 /home/ubuntu/.local/share/virtualenvs/ENV_B/bin/easy_install-3.5:#!/home/ubuntu/.local/share/virtualenvs/ENV_A/bin/python3 /home/ubuntu/.local/share/virtualenvs/ENV_B/bin/easy_install:#!/home/ubuntu/.local/share/virtualenvs/ENV_A/bin/python3 /home/ubuntu/.local/share/virtualenvs/ENV_B/bin/wheel:#!/home/ubuntu/.local/share/virtualenvs/ENV_A/bin/python3 /home/ubuntu/.local/share/virtualenvs/ENV_B/bin/pip:#!/home/ubuntu/.local/share/virtualenvs/ENV_A/bin/python3
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/berdario/pew/issues/135, or mute the thread https://github.com/notifications/unsubscribe-auth/AAt8w4eCIdxAWl9xh6pPT8uJglhQgZDHks5rc-xggaJpZM4MCoie .
Hello. Thank you for bringing
pew
into this world :)I'm on pew version
0.1.26
I created an environment
BLOTTER_FINANCE
with it, ran a fewpip install
, then I didpew rename BLOTTER_FINANCE DJANGO_ZIPLINE
, but then the following happened:eventhough the following works
So I checked all the updated references after the
rename
with agrep
:And grep'd for the references that are still pointing at the old name
Then I used the following
sed
commands:and now it works:
Also, notice how now the
pew in DJANGO_ZIPLINE pip --version
usespython3.5
folder instead ofpython2.7
.Finally, here is a short and complete sequence of commands that can recreate this issue