Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
detly opened this issue Nov 6, 2018 · 4 comments
Labels

Comments

@detly
Copy link

detly commented Nov 6, 2018

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?)

@thebjorn thebjorn added the bug label Nov 6, 2018
@thebjorn
Copy link
Collaborator

thebjorn commented Nov 6, 2018

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

@detly detly changed the title Path with spaces in -p argument results in "was unexpected at this time" Path with parentheses in -p argument results in "was unexpected at this time" Nov 7, 2018
thebjorn added a commit that referenced this issue Nov 7, 2018
@thebjorn
Copy link
Collaborator

thebjorn commented Nov 7, 2018

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

@cepbrian
Copy link

cepbrian commented Oct 18, 2022

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

@thebjorn
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants