virtualenvwrapper-win icon indicating copy to clipboard operation
virtualenvwrapper-win copied to clipboard

Path with parentheses in -p argument results in "was unexpected at this time"

Open detly opened this issue 7 years ago • 4 comments

Using:

  • Windows 10
  • Python 3.6.0
  • virtualenvwrapper-win 1.2.5

When I try to use the -p flag to point to a specific Python installation that happens to be in a path with spaces, I get an error:

> mkvirtualenv -p "C:\Program Files (x86)\Python36-32\python.exe" myenv
\Python36-32\python.exe"" was unexpected at this time.

I have tried no quotes, single quotes, and backslash escaping the spaces and parentheses (and other backslashes). It is definitely the correct path, since this works:

> "C:\Program Files (x86)\Python36-32\python.exe"
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

I don't know much about Batch scripting, but I believe this error usually comes up when a ) is interpreted as closing a control structure prematurely.

(Also there seems to be a typo in mkvirtualenv.bat: virualenv_param_options should probably be virtualenv_param_options?)

detly avatar Nov 06 '18 21:11 detly

It looks like it's actually the parenthesis (x86) which is the problem..

thebjorn avatar Nov 06 '18 23:11 thebjorn

Looks like my checkin clobbered some code. I'll rework it tomorrow (central EU timezone here).

thebjorn avatar Nov 07 '18 00:11 thebjorn

Did this ever get fixed? I'm still having this problem

I just installed virtualenvwrapper from pip so I'm pretty sure I have the most up to date version

cepbrian avatar Oct 18 '22 14:10 cepbrian

You should be able to use just -p3.6-32 or similar (same as the py command).

thebjorn avatar Oct 19 '22 09:10 thebjorn