0

I am experiencing a problem when using virtualenv in openSuSE 12.3 with Python3:

I installed the python3 and python3-devel packages. Then I installed the newest distribute and pip and finally virtualenv using pip.

When I try to create a virtualenv I get the following error:

$ virtualenv-3.3 venv01
Using base prefix '/usr'
New python executable in venv01/bin/python3.3
Also creating executable in venv01/bin/python
Installing distribute.........................................................................................................................................................................................................................................................................................................................................................................................................done.
Installing pip....
  Complete output from command /home/user/venv01/bin/python3.3 -x /home/user/venv01/bin/easy_install /usr/local/lib/pytho...ort/pip-1.3.1.tar.gz:
  /home/user/venv01/bin/python3.3: can't open file '/home/user/venv01/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv-3.3", line 9, in <module>
    load_entry_point('virtualenv==1.9.1', 'console_scripts', 'virtualenv-3.3')()
  File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 979, in main
    no_pip=options.no_pip)
  File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 1094, in create_environment
    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
  File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 667, in install_pip
    filter_stdout=_filter_setup)
  File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 1057, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/user/venv01/bin/python3.3 -x /home/user/venv01/bin/easy_install /usr/local/lib/pytho...ort/pip-1.3.1.tar.gz failed with error code 2

Running it with -vvv yields some interesting output that shows that distribute is extracted to <venv>/local/lib/python3.3/site-packages/.

I wonder why distribute is not installed into <venv>/lib/python3.3/site-packages/?

Does anyone have an idea why this happens and how I can use virtualenv in openSuSE without compiling python3 myself?

BergmannF
  • 9,727
  • 3
  • 37
  • 37

1 Answers1

1

[now fixed in latest patches from opensuse]

[oh! i just realised you are the same person as the original link. sorry. but i will leave this as it is a top result for google search on this issue (was searching myself for any update) so it may help others.]

this is a known issue, discussed at https://forums.opensuse.org/english/get-technical-help-here/applications/484475-using-virtualenv-python-3-a.html and with an open bug at https://bugzilla.novell.com/show_bug.cgi?id=809831

the only work-around i know of is to install everything yourself. it's not so hard, and i describe what is necessary at http://www.acooke.org/cute/GettingPyt0.html

basically:

  • install python 3.3 from source (do an "altinstall" to install as /usr/local/bin/python3.3)

  • fix the lib issue (link lib_dynload from /usr/local/lib64/python3.3 to /usr/local/lib/python3.3)

  • install distutils

  • install virtualenv

then you can use python3.3 and virtual-env-3.3 etc as expected.

andrew cooke
  • 45,717
  • 10
  • 93
  • 143
  • Yep I know - I asked the question in the forums. I just had hoped that maybe someone on stackoverflow has some better understanding of the involved bits like `distutils` and `site`-specific customizations and might provide a pointer to solve it. The main problem when building from source is that I have to think about including things like `tkinter` integration from the start, which I am quite likely to forget or realize to late that I actually needed them. – BergmannF Mar 28 '13 at 08:56
  • indeed. although (unlike early pythons) python3.3 does list the missing libraries at the end of `make` (so you still have to build it at least twice - once hoping it is ok, and a second time after providing missing dependencies). – andrew cooke Mar 28 '13 at 13:10