Closed
Bug 669552
Opened 14 years ago
Closed 11 years ago
No module named jetpack_sdk_env
Categories
(Add-on SDK Graveyard :: General, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: arky, Assigned: KWierso)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0a1) Gecko/20110613 Firefox/7.0a1
Build ID: 20110613233742
Steps to reproduce:
When you do 'source bin/activate' from a parent directory you will get this error.
c$ source addon-sdk/bin/activate
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named jetpack_sdk_env
When you are in the root directory 'addon-sdk' it works.
$ cd addon-sdk/
$ source bin/activate
Welcome to the Add-on SDK. Run 'cfx docs' for assistance.
Updated•14 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Target Milestone: --- → 1.1
Assignee | ||
Comment 1•13 years ago
|
||
(Pushing all open bugs to the --- milestone for the new triage system)
Target Milestone: 1.1 → ---
Assignee | ||
Comment 2•13 years ago
|
||
The activate scripts set %VIRTUAL_ENV% (or $VIRTUAL_ENV) to the current directory, which fails, because the scripts then look in VIRTUAL_ENV/python-lib for the jetpack_sdk_env file.
I think I have a "fix" for the Windows activate.bat file. Not sure exactly how to copy the change over to the other activate scripts...
This pull request adds a warning in the activate.bat file when it can't locate the python-lib folder directly underneath %VIRTUAL_ENV%, and then jumps to the end of the script so no further code is run.
Assignee: nobody → kwierso
Attachment #567655 -
Flags: review?(myk)
Comment 3•13 years ago
|
||
Comment on attachment 567655 [details]
Make activate.bat warn the user if activate script is not run from the SDK root.
Comments in the pull request.
Attachment #567655 -
Flags: review?(myk) → review-
Comment 4•13 years ago
|
||
An even better fix would be to set the various paths correctly even if the user is not in the root directory, f.e. by setting VIRTUAL_ENV to the parent directory of the directory in which the activate script is located.
Note also that VIRTUAL_ENV is set twice (without being changed in between) in bin/activate, which seems redundant and is worth removing in the process, since you're making changes in that area of the code.
Comment 5•13 years ago
|
||
Such work has already been done by myself for our Mozmill environment. Feel free to take out some of our code for it. Our repository you can find here:
https://github.com/whimboo/mozmill-environment
Related files:
https://github.com/whimboo/mozmill-environment/blob/master/linux/templates/run.sh
https://github.com/whimboo/mozmill-environment/blob/master/linux/templates/bin/activate
Whereby run.sh is a wrapper script which can execute commands from within the environment without requiring to source the activate script.
Reporter | ||
Comment 6•11 years ago
|
||
Works for me on latest release (commit ad58ee0e01d0b7e00a5baa4717262fa35a9e2ecf)
$ source addon-sdk/bin/activate
Welcome to the Add-on SDK. Run 'cfx docs' for assistance.
$ source ~/src/addon-sdk/bin/activate
Welcome to the Add-on SDK. Run 'cfx docs' for assistance.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Comment 7•11 years ago
|
||
A brand new clone of addon-sdk gave me this:
lcrouch-14912:addon-sdk lcrouch$ pwd
/Users/lcrouch/code/mozilla/addon-sdk
* master
lcrouch-14912:addon-sdk lcrouch$ source bin/activate
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named jetpack_sdk_env
(addon-sdk
* master)lcrouch-14912:addon-sdk lcrouch$
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Comment 8•11 years ago
|
||
note: Mac OS X 10.8.5 w/ python 2.7.3
Comment 9•11 years ago
|
||
Nevermind, I'm dumb. I have a local alias for pwd:
alias pwd="pwd && git branch 2> /dev/null"
So it was adding extra output to pwd and therefore VIRTUAL_ENV.
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•