Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: [Opgelost] Help. Virtualenv error bij startup bash  (gelezen 285 keer)

Offline MKe

  • Lid
[Opgelost] Help. Virtualenv error bij startup bash
« Gepost op: 2013/07/18, 10:51:54 »
Hoi,

Ik heb ineens een error als ik een shell open. Zeer irritant:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/virtualenvwrapper/hook_loader.py", line 12, in <module>
    import optparse
  File "/usr/lib/python2.7/optparse.py", line 90, in <module>
    from gettext import gettext
  File "/usr/lib/python2.7/gettext.py", line 49, in <module>
    import locale, copy, os, re, struct, sys
  File "copy.py", line 5, in <module>
    fin = file(sys.argv[1],'r')
IOError: [Errno 2] No such file or directory: '--script'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
    from apport.report import Report
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 15, in <module>
    import xml.dom, xml.dom.minidom
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 21, in <module>
    from xml.dom.xmlbuilder import DOMImplementationLS, DocumentLS
  File "/usr/lib/python2.7/xml/dom/xmlbuilder.py", line 3, in <module>
    import copy
  File "copy.py", line 5, in <module>
    fin = file(sys.argv[1],'r')
IOError: [Errno 2] No such file or directory: '--script'

Original exception was:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/virtualenvwrapper/hook_loader.py", line 12, in <module>
    import optparse
  File "/usr/lib/python2.7/optparse.py", line 90, in <module>
    from gettext import gettext
  File "/usr/lib/python2.7/gettext.py", line 49, in <module>
    import locale, copy, os, re, struct, sys
  File "copy.py", line 5, in <module>
    fin = file(sys.argv[1],'r')
IOError: [Errno 2] No such file or directory: '--script'
virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenv has been installed for VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is set properly.
Ik heb virutal env verwijderd en opnieuw geinstalleerd, maar het helpt niet.

mijn $WORKON_HOME
mke@mylinux:~$ echo $WORKON_HOME
/home/mke/.virtualenvs

Heb nog geprobeerd de volgende regels aan de .bashrc toe te voegen:
export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME"
export VIRTUALENVWRAPPER_HOOK_DIR="$WORKON_HOME"
Maar dit werkt ook niet. Help?
« Laatst bewerkt op: 2013/07/19, 09:04:11 door MKe »
Mijn blokkendoos blog: http://mke21.wordpress.com/

Offline MKe

  • Lid
Re: Help. Virtualenv error bij startup bash
« Reactie #1 Gepost op: 2013/07/19, 09:01:25 »
Okay, opgelost. Ik had een snel scripje gemaakt die copy.py heette en die in mijn home gezet. Die probeert virtualenv vervolgens te importeren. Beetje suf probleem.

Leer voor allen die programmeren. Geef modules duidelijke unieke namen waarvan het niet waarschijnlijk is dat het ergens anders nog gebruikt wordt.