{"action":"created","issue":{"url":"https://api.github.com/repos/pyside/PySide/issues/129","repository_url":"https://api.github.com/repos/pyside/PySide","labels_url":"https://api.github.com/repos/pyside/PySide/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/pyside/PySide/issues/129/comments","events_url":"https://api.github.com/repos/pyside/PySide/issues/129/events","html_url":"https://github.com/pyside/PySide/issues/129","id":109492814,"number":129,"title":"PySide in relocatable virtualenv: Library not loaded: @rpath/libpyside-python2.7.1.2.dylib","user":{"login":"fredrikaverpil","id":994357,"avatar_url":"https://avatars.githubusercontent.com/u/994357?v=3","gravatar_id":"","url":"https://api.github.com/users/fredrikaverpil","html_url":"https://github.com/fredrikaverpil","followers_url":"https://api.github.com/users/fredrikaverpil/followers","following_url":"https://api.github.com/users/fredrikaverpil/following{/other_user}","gists_url":"https://api.github.com/users/fredrikaverpil/gists{/gist_id}","starred_url":"https://api.github.com/users/fredrikaverpil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredrikaverpil/subscriptions","organizations_url":"https://api.github.com/users/fredrikaverpil/orgs","repos_url":"https://api.github.com/users/fredrikaverpil/repos","events_url":"https://api.github.com/users/fredrikaverpil/events{/privacy}","received_events_url":"https://api.github.com/users/fredrikaverpil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":60,"created_at":"2015-10-02T13:40:50Z","updated_at":"2016-12-22T06:50:59Z","closed_at":null,"body":"I'm pip installing PySide into a virtualenv:\n\n```\nsudo virtualenv --always-copy $VENV\nsource $VENV/bin/activate\nsudo $VENV/bin/pip install pyside\nsudo $VENV/bin/python $VENV/bin/pyside_postinstall.py -install\ndeactivate\n```\n\nThe virtualenv works great and I can run my Python/PySide script without problems:\n\n```\n$VENV/bin/python $SCRIPT\n```\n\nNow, I make my virtualenv relocatable: \n\n```\nvirtualenv --relocatable $VENV\n```\n\nI move it:\n\n```\nmv $VENV $VENV_RELOCATED\n```\n\n...and again run my script:\n\n```\nsource $VENV_RELOCATED/bin/activate\n$VENV_RELOCATED/bin/python $SCRIPT\n```\n\nThis time around, I'm getting an error:\n\n```\nTraceback (most recent call last):\n  File \"script.py\", line 1, in <module>\n    from PySide import QtCore, QtGui, QtUiTools\nImportError: dlopen(/absolute/path/to/relocated_venv/lib/python2.7/site-packages/PySide/QtCore.so, 2): Library not loaded: @rpath/libpyside-python2.7.1.2.dylib\n  Referenced from: /absolute/path/to/relocated_venv/lib/python2.7/site-packages/PySide/QtCore.so\n  Reason: image not found\n```\n\nThese are the contents of the script:\n\n```\nfrom PySide import QtCore, QtGui, QtUiTools\n```\n\nPlease note: the absolute path printed twice in the error message is the $VENV_RELOCATED\n\nThis is all on OS X 10.11.0 with Python 2.7.10 and PySide 1.2.2.\n\nAny ideas on workaround so that the virtualenv could be moved around?\n"},"comment":{"url":"https://api.github.com/repos/pyside/PySide/issues/comments/268731391","html_url":"https://github.com/pyside/PySide/issues/129#issuecomment-268731391","issue_url":"https://api.github.com/repos/pyside/PySide/issues/129","id":268731391,"user":{"login":"fredrikaverpil","id":994357,"avatar_url":"https://avatars.githubusercontent.com/u/994357?v=3","gravatar_id":"","url":"https://api.github.com/users/fredrikaverpil","html_url":"https://github.com/fredrikaverpil","followers_url":"https://api.github.com/users/fredrikaverpil/followers","following_url":"https://api.github.com/users/fredrikaverpil/following{/other_user}","gists_url":"https://api.github.com/users/fredrikaverpil/gists{/gist_id}","starred_url":"https://api.github.com/users/fredrikaverpil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredrikaverpil/subscriptions","organizations_url":"https://api.github.com/users/fredrikaverpil/orgs","repos_url":"https://api.github.com/users/fredrikaverpil/repos","events_url":"https://api.github.com/users/fredrikaverpil/events{/privacy}","received_events_url":"https://api.github.com/users/fredrikaverpil/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T06:50:59Z","updated_at":"2016-12-22T06:50:59Z","body":"In response to my previous post;\r\n\r\nI haven't tested this myself (moved on to PySide2), but this could perhaps work:\r\n```bash\r\n# QtGui.so\r\ninstall_name_tool -change QtGui.so @executable_path/../lib/python2.7/site-packages/PySide/QtGui.so venv/lib/python2.7/site-packages/PySide/QtGui.so\r\n```"}}
{"actor":{"display_login":"fredrikaverpil"}}