-
Notifications
You must be signed in to change notification settings - Fork 43
Conflicts with Python virtualenv due to same name of environment variable #60
Comments
Ouch... good catch! You can tell we're not Python devs. ;) @ramsey @jwoodcock Thoughts on switching to |
This is actually on purpose. To insure we don't have any collisions with python, we put this test in to prevent a user from activating a virtPHP env while they were in an active Python virtualenv. We did this because we were concerned that virtualenv is doing something, or would be doing something that we would create a conflict between both tools. |
Hmm... is this a case of premature optimization maybe? I mean, do we know that there is some conflict? |
The primary conflict is the I suppose we could give our |
Ugh... As much as I don't want to have None of these sound like desirable solutions though. |
I think the current solution is the best solution and vote for keeping it. But I'm always open to good reason for changing it, though none listed are what I would consider good. The thought of a dev using both python and php at the same time is so fringe, especially if you include this is all based on the current terminal session. So if I wanted both python and php going without this conflict, all I have to do is open another terminal session. |
Well, if they're calling a python script from within php then opening another terminal session wouldn't solve the problem. But I agree that it is a fringe use case. Perhaps we can just put a warning in the README and maybe in that error message when we detect an existing virtual env? |
So this warning isn't enough? ;) "You are currently running a virtualenv session: /home/username/local/python/3" |
@djbclark So when you hit this message, were you needing both the Python virtualenv and virtPHP env running at the same time? |
Let's keep this open for a bit. I'm working on a PHP Twig extension that uses Python's Pygments library. I'll try using virtPHP together with virtualenv to see how things go. My suspicion is that PHP is unaware of the current terminal session, so even if a virtualenv environment is active, it's not going to use the Just a hypothesis for now. I'll test it. |
why the hell we want to virtuals env on the same terminal? |
$ source .virtphp/envs/php5/bin/activate
You are currently running a virtualenv session: /home/username/local/python/3
Please exit this session before starting a virtPHP session.
It looks like it's because it searches for this env variable in the actuvate scriptL
if [ "$VIRTUAL_ENV" ] ; then
Changing that to PHP_VIRTUAL_ENV seems to have fixed the problem, did a quick look and didn't find that used anywhere else.
The text was updated successfully, but these errors were encountered: