Skip to content

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

@detly

Description

@detly

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions