adrianlc / sublime-text-virtualenv Goto Github PK
View Code? Open in Web Editor NEWManage your virtualenvs directly from Sublime Text 3
Home Page: https://github.com/AdrianLC/sublime-text-virtualenv
License: MIT License
Manage your virtualenvs directly from Sublime Text 3
Home Page: https://github.com/AdrianLC/sublime-text-virtualenv
License: MIT License
I recently upgraded to ST3 3176. When I browse packages, virtualenv is not there. when I search to install or select activate, it does not come up. Is this just me, or is there a problem with your app and the upgrade? Is there a fix? Thanks.
I use this plugin with SublimeREPL and have had no problems until now. However, I'm just now trying to import a locally defined module within SublimeREPL + virtualenv, and I'm getting an ImportError.
Here's my folder structure (main.py tries to import a Class defined in utilities.py):
folder/
main.py
utilities.py
init.py
If I use SublimeREPL with no virtualenv, I can successfully import the module.
If I use bash and activate the virtualenv from there, and then open up a Python shell, I can also successfully import the module.
Any ideas? Thanks!
import sys
print("sys.stdout.encoding", sys.stdout.encoding)
RESULT: sys.stdout.encoding US-ASCII
I have tried adding "env": {"LANG": "en_US.UTF-8"}, in the Virtualenv.sublime-settings, but it didn't work.
I have Anaconda installed with Python 2.7 on Windows 10, and I created a virtual environment that uses Python 3.5. If I activate the Python 3.5 virtual environment within SublimeText and run the following code
import sys print(sys.version)
I get the following output
2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jun 29 2016, 11:07:13) [MSC v.1500 64 bit (AMD64)]
which is obviously not Python 3.5. Opening a command prompt, activating my Python 3.5 virtual environment, and executing the same code yields
3.5.3 |Anaconda 4.4.0 (64-bit)| (default, May 15 2017, 10:43:23) [MSC v.1900 64 bit (AMD64)]
Additionally, I've saved the Sublime Project to see if it's setting the virtual environment correctly, and it appears to be
"virtualenv": "C:\\Users\\My Name\\Anaconda2\\envs\\python3env"
What might be prohibiting my SublimeText installation from building with the alternative environment?
Hi!
how can I run the build with Terminus instead of using the console, so I can get nice features like colors and so on?
Python+Virtualenv build uses virtualenv_exec as target, while terminus uses terminus exec as target.
Thanks!
I have tried the latest version on Mac OS, but I still cannot build my project properly using virtualenv. In my virtualenv I used Python 3.5, but when I used python + virtualenv
to build, it used Python 2.9.
When I do virtualenv : activate
, I didn't get anything and the building still does not work.
Any suggestions?
postactivate seems to not be loaded.
To test it I added a path to $PYTHONPATH
:
export OLD_PYTHONPATH="$PYTHONPATH"
if [ -z $PYTHONPATH ]; then
export PYTHONPATH=/home/bsemene/dev/logging_handlers
else
export PYTHONPATH=$PYTHONPATH:/home/bsemene/dev/logging_handlers
fi
On the console I execute the following in my virtualenv:
$python -c "import sys ; import os ; print os.getenv('PYTHONPATH') in sys.path"
True
And on sublime (after activating the virtualenv):
print '/home/bsemene/dev/logging_handlers' in sys.path
returns False
Sorry to interrupt.
Could you tell me how to automatically enter virtualenv without manually activate?
I want an effect like this:
①double click a xx.py file and enter into sublime
②without manual activate the virtualenv,it already enter into python2.7 of virtualenv
③if I want to change to virtualenv-python3.5,I can use shift+ctrl+p->activate->python3.5
Why I want this effect?
Because in my .bashrc ,I added the following 3 lines
**alias py2.7="source /home/appleyuchi/.virtualenvs/python2.7/bin/activate&&deactivate&&source /home/appleyuchi/.virtualenvs/python2.7/bin/activate"
alias py3.5="source /home/appleyuchi/.virtualenvs/python3.5/bin/activate&&deactivate&&source /home/appleyuchi/.virtualenvs/python3.5/bin/activate"
py2.7**
So,dear sir ,does sublime-text-virtualenv has similar settings?
Thanks very much .
if i lauch sublime in terminal already in virtualenv-python2.7,then I cannot use sublime-text-virtualenv to change to python3.5,so this is not a good solution.
Many Thanks again
Hi,
When running this on a Mac I get a UTF-8 local error.
When running scripts through the terminal:
source venv/bin/activate
python test.py
I am able to resolve the issue by editing the ~./bash_profile and adding two lines -
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
When running a python file using the virtualenv package, it is not possible to cancel the build using the 'Cancel Build' button located in Tools
tab
From integrations.py#L32, which is the same with REPL's method. I cannot see its benefits comparing to its flaws.
My recommendation is in my PR at wuub/SublimeREPL#515. Since mans there do not response, what do you think of it?
I'm developing a Python package (in Windows) which is linked to my global site-packages with the usual setup.py develop
. When I activate the virtualenv using the plugin and try to import mymodule
I get an ImportError
. Other locally installed packages (i.e. not egg-linked) work fine.
I thought this might be an issue with my virtualenv, but if I activate it from a command prompt and open a Python shell I can import my module without any issues. It seems like there's an problem with Sublime not recognizing egg-linked modules -- is there some workaround for this?
Many thanks
I generally have the habit to put my virtualenvs inside each project directory, and I use direnv to generate and activate my virtualenv automatically inside the project directory in the terminal.
However, this workflow seems not supported by this plugin: I can't find a way to specify in "virtualenv_directories" to search in the current project directory.
Is this possible currently?
If not, can this be added?
Hi there,
I was hoping this might be the easy answer to my problems of deal with virtualenvs within ST3. I followed all the instructions and it doesn't seem to work on Mac OS. When I try to activate a virtualenv from the command palette, it correctly lists the environments. There don't seem to be any issues with running the activate command; however even when I choose the Python + Virtualenv
build system specifically, it doens't seem to run python within the activated environment.
Any suggestions as to how to diagnose the issues? Would be great to get this working.
Thanks!
I have a virtualenv created with Pipenv, but this plugin doesn't seem to be able to activate it.
sublime-text-virtualenv/commands.py
Line 11 in e05905a
Tried with ST4 and got the following in the console
Packages/Virtualenv.sublime-package/commands.py", line 126, in <module>
AttributeError: 'module' object has no attribute 'exec'
To get this package working in ST4 I unzipped the package, created a file in the root of this package called .python-version with the contents of 3.8, and zipped it up. Now working and backwards compatible with ST2 and ST3. Will submit a PR.
I'm running ST3 build 3114 with the virtualenv package. I added 3 venvs using the directory add option. Later on I deleted those venvs and recreated them, re-adding the directory. Now after this when I attempt to Activate one of the venvs, it lists 6, 2 sets of 3s. Then I re-added the venvs from the directory and now it shows 9, 3 sets of 3s. I can't delete one of the options as it will delete the venv i created. But if I do delete it, then it's removed from all 3 sets. Here is a screenshot I hope can explain it better: http://i.imgur.com/KOiOYkK.png
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.