Home Download Buy Blog Forum Support

Elegant solution for virtualenv?

Elegant solution for virtualenv?

Postby ultrakomm on Sun Nov 18, 2012 10:16 am

Hi!

I'm looking for an elegant solution for working with Python virtualenv. Does anyone have one? I've tried to search for one, but I haven't found any that aren't very hackish.

Best regards,
ultra
ultrakomm
 
Posts: 1
Joined: Sun Nov 18, 2012 10:15 am

Re: Elegant solution for virtualenv?

Postby jtourlamain on Tue Jul 07, 2015 7:04 am

Hi

I've created a virtualenv for MyProject. When workon MyProject python 3.4 is used. When opening the project in ST3, python 2 is used.
I've changed my project settings to use:
"settings'": {"python_interpreter": "~/.virtualenv/MyProject/bin/python"}
If I cmd+B on a test.py file with print(sys.version_info) it still gives me python 2
Executing from the command line gives my python 3

What else do I need to change to make ST3 work with my virtualenv?

Kind regards

Jan
jtourlamain
 
Posts: 2
Joined: Tue Jul 07, 2015 6:54 am

Re: Elegant solution for virtualenv?

Postby jtourlamain on Tue Jul 07, 2015 7:13 am

Apparently I needed to change my Build System to "Anaconda Python Builder" as well :oops:
jtourlamain
 
Posts: 2
Joined: Tue Jul 07, 2015 6:54 am

Re: Elegant solution for virtualenv?

Postby FichteFoll on Tue Jul 07, 2015 8:00 am

Yes, you need to adjust the build for python. I suppose an auto-search plugin that looks for potential viertualenvs before defaulting to the standard interpreter is reasonable.
FichteFoll
 
Posts: 734
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Elegant solution for virtualenv?

Postby corndogcomputers on Wed Jul 08, 2015 7:10 pm

Here's the build systems I wrote for virtualenvs. It will create them in the script directory if they don't exist.

https://gist.github.com/corndogcomputer ... dd4907e15c
corndogcomputers
 
Posts: 2
Joined: Tue Apr 21, 2015 8:46 pm


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 20 guests