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

virtualenv not working in Python 2.7.6.1 #33

Open
chrischmo opened this issue Sep 17, 2014 · 0 comments
Open

virtualenv not working in Python 2.7.6.1 #33

chrischmo opened this issue Sep 17, 2014 · 0 comments

Comments

@chrischmo
Copy link

I've installed PortablePython on a 64bit Win7 machine but cannot use virtualenv (installed via pip).

Background: The machine has python2.7.5 pre-installed but I do not have permission to install anything on it via easy_install/pip. So I installed PortablePython into my user folder (shortened the name of the installation folder to PortablePython) and wrote a .bat file that starts cmd with the following folders added to PATH:

@set python_install_root=U:\Apps\PortablePython\App
@set PATH=%python_install_root%;%python_install_root%\Lib;%python_install_root%\DLLs;%python_install_root%\Scripts;%PATH%

The interpreter starts up fine and pip as well as virtualenv got installed without problems, but whenever I try to create a virtual environment, the following happens:

U:\Docs\Code\flask_book\flasky>virtualenv venv
New python executable in venv\Scripts\python.exe
Installing setuptools, pip...
  Complete output from command U:\Docs\Code\flask_b...v\Scripts\python.exe -c "import sys, pip; sys.
..d\"] + sys.argv[1:]))" setuptools pip:
  Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking setuptools
Cleaning up...
Exception:
Traceback (most recent call last):
  File "U:\Apps\PortablePython\App\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.w
hl\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "U:\Apps\PortablePython\App\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.w
hl\pip\commands\install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "U:\Apps\PortablePython\App\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.w
hl\pip\req.py", line 1177, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "U:\Apps\PortablePython\App\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.w
hl\pip\index.py", line 209, in find_requirement
    file_locations, url_locations = self._sort_locations(locations)
  File "U:\Apps\PortablePython\App\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.w
hl\pip\index.py", line 128, in _sort_locations
    sort_path(os.path.join(path, item))
  File "U:\Apps\PortablePython\App\lib\site-packages\virtualenv_support\pip-1.5.6-py2.py3-none-any.w
hl\pip\index.py", line 109, in sort_path
    if mimetypes.guess_type(url, strict=False)[0] == 'text/html':
  File "U:\Apps\PortablePython\App\Lib\mimetypes.py", line 297, in guess_type
    init()
  File "U:\Apps\PortablePython\App\Lib\mimetypes.py", line 358, in init
    db.read_windows_registry()
  File "U:\Apps\PortablePython\App\Lib\mimetypes.py", line 258, in read_windows_registry
    for subkeyname in enum_types(hkcr):
  File "U:\Apps\PortablePython\App\Lib\mimetypes.py", line 249, in enum_types
    ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 32: ordinal not in range(128)

Storing debug log for failure in U:\pip\pip.log
----------------------------------------
...Installing setuptools, pip...done.
Traceback (most recent call last):
  File "U:\Apps\PortablePython\App\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "U:\Apps\PortablePython\App\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "U:\Apps\PortablePython\App\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
  File "U:\Apps\PortablePython\App\lib\site-packages\virtualenv.py", line 824, in main
    symlink=options.symlink)
  File "U:\Apps\PortablePython\App\lib\site-packages\virtualenv.py", line 992, in create_environment

    install_wheel(to_install, py_executable, search_dirs)
  File "U:\Apps\PortablePython\App\lib\site-packages\virtualenv.py", line 960, in install_wheel
    'PIP_NO_INDEX': '1'
  File "U:\Apps\PortablePython\App\lib\site-packages\virtualenv.py", line 902, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command U:\Docs\Code\flask_b...v\Scripts\python.exe -c "import sys, pip; sys...d\"] + sys.a
rgv[1:]))" setuptools pip failed with error code 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant