Princeton University Python Community

It is currently 26 Sep 2017, 16:33


Mising VCRUNTIME file when creating virtual environment

Python-related conversation : share code, get help, show off some cool projects.
  • Author
  • Message
Offline

jhoskins32

  • Posts: 3
  • Joined: 10 Nov 2015, 22:59

Mising VCRUNTIME file when creating virtual environment

Post10 Nov 2015, 23:11

Hi all,

I'm very new to python, and have been trying to deploy a very simple django web app I made (just to practice python/django) but I keep running into a problem.

It seems to be a requirement that I create a virtual environment, but whenever I try (using 'virtualenv venv' at the command line) I get the error:

"The program can't start because VCRUNTIME140.dll is missing from your computer. Try reinstalling the program to fix this problem."

I've tried reinstalling python and re-piping virtualenv but that doesn't seem to work. There were one or two references to this problem online, both of which suggested downloading Virtual C++ redistribute (https://www.microsoft.com/en-us/downloa ... x?id=48145), but that didn't work either.

Anyone have any thoughts on what else I could try? Last note: I'm using the latest python version(3.5.0)

Thanks so much!

Jack
Offline

Quentin

Site Admin

  • Posts: 83
  • Joined: 16 Jan 2014, 10:59

Re: Mising VCRUNTIME file when creating virtual environment

Post10 Nov 2015, 23:51

I assume you've read through this ?
https://docs.djangoproject.com/en/1.8/howto/windows/

vcruntime140.dll is part of the Visual C++ suite of tools, and is part of the redistributable. Just checking you've installed the right one :
https://www.microsoft.com/en-us/downloa ... x?id=48145

This is a known issue in Anaconda. You haven't specified your system and Python setup, but if you're going through Anaconda, you might just need an update. See :
https://github.com/ContinuumIO/anaconda ... issues/443
If that's the case, try running
Code: [Select all] [Expand/Collapse] [Download] (Untitled)
  1. conda update conda
  2. conda update anaconda
GeSHi © Codebox Plus

You may also want to try adding the file that contains that dll to your PATH, as is mentioned in this Github issue.

Let us know.
Offline

jhoskins32

  • Posts: 3
  • Joined: 10 Nov 2015, 22:59

Re: Mising VCRUNTIME file when creating virtual environment

Post12 Nov 2015, 14:02

Thanks so much, that worked!

I actually have no idea why it worked. I didn't previously have anaconda, but after trying the other solutions with no success I downloaded anaconda and suddenly it worked.

---

I hope it's alright if I ask one more question - I'm still trying to get this django app working, but now I'm having trouble with the psycopg2 file. The full error message is below, but in short I can't seem to install it in my virtual environment. I have PostgreSQL installed (and updated my path to point to it), but when I use the command:

(venv) C:\Users\Jack\python-getting-started>pip install -r requirements.txt -- allow-all-external

I get an error saying "Failed building wheel for psycopg2." I get the exact same error for the more simple command 'pip install psycopg2'

The guide I've been following in all of this is:
https://devcenter.heroku.com/articles/g ... pendencies
(this links to the section of the guide during which the error takes place)

Thanks so much for any help you can give me, and for helping me solve the earlier problem!




full error:

(venv) C:\Users\Jack\python-getting-started>pip install -r requirements.txt --
low-all-external
Requirement already satisfied (use --upgrade to upgrade): dj-database-url==0.3
in c:\users\jack\python-getting-started\venv\lib\site-packages (from -r requi
ments.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): Django==1.8.1 in c:\
ers\jack\python-getting-started\venv\lib\site-packages (from -r requirements.t
(line 2))
Requirement already satisfied (use --upgrade to upgrade): django-postgrespool=
.3.0 in c:\users\jack\python-getting-started\venv\lib\site-packages (from -r r
uirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): gunicorn==19.3.0 in
\users\jack\python-getting-started\venv\lib\site-packages (from -r requirement
txt (line 4))
Collecting psycopg2==2.6.1 (from -r requirements.txt (line 5))
Using cached psycopg2-2.6.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): SQLAlchemy==1.0.4 in
:\users\jack\python-getting-started\venv\lib\site-packages (from -r requiremen
.txt (line 6))
Requirement already satisfied (use --upgrade to upgrade): whitenoise==1.0.6 in
:\users\jack\python-getting-started\venv\lib\site-packages (from -r requiremen
.txt (line 7))
Building wheels for collected packages: psycopg2
Running setup.py bdist_wheel for psycopg2
Complete output from command c:\users\jack\python-getting-started\venv\scrip
\python.exe -c "import setuptools;__file__='C:\\Users\\Jack\\AppData\\Local\\T
p\\pip-build-14qk5_kb\\psycopg2\\setup.py';exec(compile(open(__file__).read().
place('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\Jack\AppData\
cal\Temp\tmpzthiq0k9pip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.5
creating build\lib.win32-3.5\psycopg2
copying lib\errorcodes.py -> build\lib.win32-3.5\psycopg2
copying lib\extensions.py -> build\lib.win32-3.5\psycopg2
copying lib\extras.py -> build\lib.win32-3.5\psycopg2
copying lib\pool.py -> build\lib.win32-3.5\psycopg2
copying lib\psycopg1.py -> build\lib.win32-3.5\psycopg2
copying lib\tz.py -> build\lib.win32-3.5\psycopg2
copying lib\_json.py -> build\lib.win32-3.5\psycopg2
copying lib\_range.py -> build\lib.win32-3.5\psycopg2
copying lib\__init__.py -> build\lib.win32-3.5\psycopg2
creating build\lib.win32-3.5\psycopg2\tests
copying tests\dbapi20.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\dbapi20_tpc.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\testconfig.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\testutils.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_async.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_bugX000.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_bug_gc.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_cancel.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_connection.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_copy.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_cursor.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_dates.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_extras_dictcursor.py -> build\lib.win32-3.5\psycopg2\test
copying tests\test_green.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_lobject.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_module.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_notify.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_psycopg2_dbapi20.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_quote.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_transaction.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_types_basic.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_types_extras.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\test_with.py -> build\lib.win32-3.5\psycopg2\tests
copying tests\__init__.py -> build\lib.win32-3.5\psycopg2\tests
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running build_ext
building 'psycopg2._psycopg' extension
error: [WinError 2] The system cannot find the file specified

----------------------------------------
Failed building wheel for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
Found existing installation: psycopg2 2.5.2
Uninstalling psycopg2-2.5.2:
Successfully uninstalled psycopg2-2.5.2
Running setup.py install for psycopg2
Complete output from command c:\users\jack\python-getting-started\venv\scr
ts\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\Jack\\AppDa
\\Local\\Temp\\pip-build-14qk5_kb\\psycopg2\\setup.py';exec(compile(getattr(to
nize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))
install --record C:\Users\Jack\AppData\Local\Temp\pip-tt51s7ui-record\install-
cord.txt --single-version-externally-managed --compile --install-headers c:\us
s\jack\python-getting-started\venv\include\site\python3.5\psycopg2:
running install
running build
running build_py
running build_ext
building 'psycopg2._psycopg' extension
error: [WinError 2] The system cannot find the file specified

----------------------------------------
Rolling back uninstall of psycopg2
Command "c:\users\jack\python-getting-started\venv\scripts\python.exe -c "impo
setuptools, tokenize;__file__='C:\\Users\\Jack\\AppData\\Local\\Temp\\pip-bui
-14qk5_kb\\psycopg2\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__
le__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Us
s\Jack\AppData\Local\Temp\pip-tt51s7ui-record\install-record.txt --single-vers
n-externally-managed --compile --install-headers c:\users\jack\python-getting-
arted\venv\include\site\python3.5\psycopg2" failed with error code 1 in C:\Use
\Jack\AppData\Local\Temp\pip-build-14qk5_kb\psycopg2


My requirements.txt file looks like this:

dj-database-url==0.3.0
Django==1.8.1
django-postgrespool==0.3.0
gunicorn==19.3.0
psycopg2==2.6.1
SQLAlchemy==1.0.4
whitenoise==1.0.6
Offline

Quentin

Site Admin

  • Posts: 83
  • Joined: 16 Jan 2014, 10:59

Re: Mising VCRUNTIME file when creating virtual environment

Post12 Nov 2015, 16:26

I was able to install psycopg2 using pip without issues.

There's a binary executable for Windows that installs psycopg2 for you :
http://stickpeople.com/projects/python/win-psycopg/
I'd grab the 64-bit version for Python 3.4, I assume it'll be compatible with your setup.

Alternatively, I've seen a few posts suggesting that people fail to install it in a virtual environment, but succeed outside a virtualenv. Have you considered installing it in the base install ?
Offline

jhoskins32

  • Posts: 3
  • Joined: 10 Nov 2015, 22:59

Re: Mising VCRUNTIME file when creating virtual environment

Post17 Nov 2015, 16:05

Downloading the executable file was a success! ... but then I got a new error at the next step.

I feel like I must be doing something fundamentally wrong. Do you think something like using Python 2 instead of 3 would be more likely to succeed? Would working on a mac significantly improve my chances of success?

More generally, I'd really like to know how to do this kind of thing. Is there a book or something you'ld recommend that might let me better troubleshoot my own problems, or is this the kind of thing you just learn to do with lots of experience (and lots of google searches?)

Thanks for all the help so far,
Jack
Offline

Quentin

Site Admin

  • Posts: 83
  • Joined: 16 Jan 2014, 10:59

Re: Mising VCRUNTIME file when creating virtual environment

Post18 Nov 2015, 10:19

The website says that it's Py3 compatible, so that shouldn't be an issue.

A lot of fixing these errors is Googling. Almost always, someone else has had the same issue, and there's a fix listed somewhere. With experience, you'll learn to better interpret the errors - what they really mean, what to look for in the logs. For this reason, if you're ever stuck when Google hasn't helped, and you post about your error somewhere, it's important to share the full error, along with the specifics of what you've done and what your system looks like. :)

As to working on a Mac... I find building, compiling, and installing software under Windows to be a pain. It's easier under Linux ( if you know how to use it, otherwise there'll be a learning curve... ). I treat my Mac like a Linux system, because they share that underlying core, so I personally find working on Macs infinitely easier than on Windows computers. Still, this should be absolutely possible under Windows, so...

Return to Everything about Python



Who is online

Users browsing this forum: No registered users and 1 guest

cron