pip install cx_freeze: "command 'cl.exe' failed: No such file or directory" - command-line

I´m on Windows 7, and i have Python 3.5.1 installed.
I want to create executables from Python scripts.
What i did so far:
I ran pip install cx_freeze and i got the Unable to find vcvarsall.bat error.
There #Cody Piersall linked to Steve Dowers blog entry.
From there i downloaded and installed the Visual C++ Build Tools 2015.
Now i have these *Microsoft Visual C++ ** ´es installed: Screenshot.
And i have the vcvars* batches installed in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\:
vcvarsall.bat
bin\vcvars32.bat
bin\amd64\vcvars64.bat.
etc
My prettyprinted PATH is:
C:\run\Python_3_5\Scripts\;
C:\run\Python_3_5\;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\ProgramData\Oracle\Java\javapath;
C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;
C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;
C:\run\Haskell-Platform\lib\extralibs\bin;
C:\run\Haskell-Platform\bin;
C:\Users\Nils-Hero\AppData\Roaming\cabal\bin;
C:\run\Haskell-Platform\mingw\bin;
C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;
C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;
Problem:
When i now rerun pip install cx_freeze, it doesn´t find a file cl.exe:
Collecting cx_freeze
Using cached cx_Freeze-4.3.4.tar.gz
Installing collected packages: cx-freeze
Running setup.py install for cx-freeze ... error
Complete output from command c:\run\python_3_5\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\NILS-H~1\\AppData\\Local\\Temp\\pip-build-9lhua9e9\\cx-freeze\\setup.py'
;exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\NILS-H~1\AppData\Local\Temp\pip-bb2i8jxv-record\install-re
cord.txt --single-version-externally-managed --compile:
adding base module named _bootlocale
adding base module named _collections_abc
adding base module named _compression
...
... adding a lot more base modules ...
...
running install
running build
running build_py
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\cx_Freeze
copying cx_Freeze\common.py -> build\lib.win-amd64-3.5\cx_Freeze
copying cx_Freeze\dist.py -> build\lib.win-amd64-3.5\cx_Freeze
...
... creating and copying a lot more things ...
...
running build_ext
building 'cx_Freeze.util' extension
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\source
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\run\python_3_5\include -Ic:\run\python_3_5\include /Tcsource/util.c /Fobuild\temp.win-amd64-3.5\Release\source/util.obj
error: command 'cl.exe' failed: No such file or directory
----------------------------------------
Command "c:\run\python_3_5\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\NILS-H~1\\AppData\\Local\\Temp\\pip-build-9lhua9e9\\cx-freeze\\setup.py';exec(compile(getattr(to
kenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\NILS-H~1\AppData\Local\Temp\pip-bb2i8jxv-record\install-record.txt --single-versio
n-externally-managed --compile" failed with error code 1 in C:\Users\NILS-H~1\AppData\Local\Temp\pip-build-9lhua9e9\cx-freeze\
This executable is under C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ and also in the subfolders.
I guess pip can´t find it because these paths are not on my PATH, but why wouldn´t that Visual C++ Build Tools 2015 installer add them? I´m scared to hand-tweak a 800MB sized, 50 minutes lasting installation. So i´ll better ask here first.

Ok. Solved.
I successfully installed cx_freeze from a wheel according to the answer to this Question.
But version 4.3.4 from the Gohlke site has a bug under Python 3.5 (ImportError: No module named '_frozen_importlib_external'). We have to wait until the cx_freeze author releases the next version of cx_freeze (which seems to be soon).
Meanwhile, Sebastian Krause was so kind to create some wheels from the latest code from repo, cx_freeze 5.0, and these wheels install and run without errors in my tests.

Related

Visual Studio Code fails to install pylint

After creating a new conda environment Visual Studio Code asks to install pylint:
If I press Install, it fails due to access restrictions:
"C:/Program Files (x86)/Microsoft Visual Studio/Shared/Anaconda3_64/envs/derm-ai/python.exe" -m pip install -U pylint
Collecting pylint
Using cached https://files.pythonhosted.org/packages/60/c2/b3f73f4ac008bef6e75bca4992f3963b3f85942e0277237721ef1c151f0d/pylint-2.3.1-py3-none-any.whl
Collecting colorama; sys_platform == "win32" (from pylint)
Using cached https://files.pythonhosted.org/packages/4f/a6/728666f39bfff1719fc94c481890b2106837da9318031f71a8424b662e12/colorama-0.4.1-py2.py3-none-any.whl
Collecting isort<5,>=4.2.5 (from pylint)
Using cached https://files.pythonhosted.org/packages/e5/b0/c121fd1fa3419ea9bfd55c7f9c4fedfec5143208d8c7ad3ce3db6c623c21/isort-4.3.21-py2.py3-none-any.whl
Collecting astroid<3,>=2.2.0 (from pylint)
Using cached https://files.pythonhosted.org/packages/d5/ad/7221a62a2dbce5c3b8c57fd18e1052c7331adc19b3f27f1561aa6e620db2/astroid-2.2.5-py3-none-any.whl
Collecting mccabe<0.7,>=0.6 (from pylint)
Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting typed-ast>=1.3.0; implementation_name == "cpython" (from astroid<3,>=2.2.0->pylint)
Using cached https://files.pythonhosted.org/packages/c1/1f/33ea7a3fecec1878e7697ca6bb0e624970f8c3cd8b8932ff6ed74b10858b/typed_ast-1.4.0-cp35-cp35m-win_amd64.whl
Collecting lazy-object-proxy (from astroid<3,>=2.2.0->pylint)
Using cached https://files.pythonhosted.org/packages/5d/e5/0898a1c288ecad4650dbd68f1fac1dda6ab4c8f70e437a8f08add75e1650/lazy_object_proxy-1.4.2-cp35-cp35m-win_amd64.whl
Collecting wrapt (from astroid<3,>=2.2.0->pylint)
Requirement already satisfied, skipping upgrade: six in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\envs\derm-ai\lib\site-packages (from astroid<3,>=2.2.0->pylint) (1.12.0)
Installing collected packages: colorama, isort, typed-ast, lazy-object-proxy, wrapt, astroid, mccabe, pylint
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Anaconda3_64\\envs\\derm-ai\\Lib\\site-packages\\colorama'
Consider using the `--user` option or check the permissions.
Although pylint can be installed from the Anaconda prompt run as administrator, I believe it should work from VSCode directly as long as they provided this function. Or am I supposed to run VS Code as administrator?
VSCode can't find pylint.exe.
You have to tell VSCode the absolute path to pylint.exe. Add the following content into your settings.json
// Path to Pylint, you can use a custom version of pylint by modifying this setting to include the full path.
"python.linting.pylintPath": "absolute to pylint.exe,
Note: Escape \ as \\ in the path value.

Buildbot installation requires msvc14

I've been trying the BuildBot First Run tutorial. It starts by creating a master and looks quite simple and straightforward, but I've encountered problems with the step pip install 'buildbot[bundle]'.
I get this error message (this is the end of the log):
building 'twisted.test.raiser' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "c:\users\remi\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Remi\\AppData\\Local\\Temp\\pip-install-10x0qptg\\Twisted\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Remi\AppData\Local\Temp\pip-record-c63k2sci\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Remi\AppData\Local\Temp\pip-install-10x0qptg\Twisted\
I've tried installing mscv build tools, but still get the same message.
Any ideas how I could fix the problem?
Problem is twisted does not yet support python 3.7 (see related issue here: Installing Twisted for Python using pip: error: Microsoft Visual Studio failed with exit status 2).
You can work around this problem by installing precompiled twisted binaries. For example from here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
E.g. in your case download Twisted‑18.9.0‑cp37‑cp37m‑win32.whl and do
pip install Twisted‑18.9.0‑cp37‑cp37m‑win32.whl
Then retry the buildbot install.
pip install 'buildbot[bundle]'

Can I run VScode on chromebook?

I'm using Chromebook(asusu c101pa).
How I get VScode without [Community builds of
Visual Studio Code]1?
I've to try community builds of vscode, couldn't run. And, I'd like to use on linux.
I've downloaded deb file of vs code. But couldn't work. Error code sys
An error occurred during installation of your Linux aaplication
So, I do install Linux command(terminal), that too.
myname#penguin:~$ sudo dpkg -i code_1.29.1-1542309157_amd64.deb
dpkg:error processing archive code_1.29.1-1542309157_amd64.deb
(--install):
package architecture (amd64) does not match system (arm64)
rrors were encountered while processing:
code_1.29.1-1542309157_amd64.deb
code_1.29.1-1542309157_amd64.deb is vscode file.
How I fix this problem?

Installing CKAN error - cannot determine reason

Here is a list of packages I had to install for CKAN 2.7.0
python-setuptools-36.2.4-4.mga7.noarch.rpm
pgdg-redhat96-9.6-3.noarch.rpm
xml-commons git subversion mercurial postgresql96-server postgresql96-devel postgresql96 python-devel libxslt libxslt-devel libxml2 libxml2-devel python-virtualenv gcc gcc-c++ make java-1.6.0-openjdk redis tomcat tomcat-webapps tomcat-admin-webapps xalan-j2unzip policycoreutils-python mod_wsgi httpd tcl-devel redis
after installing these tools i was able to download the git successfully using
pip install --ignore-installed -e git+https://github.com/okfn/ckan.git#ckan-2.7.0#egg=ckan
I then added pgsql-9.6 to the path in order for ckan to recognize pg_config
PATH=$PATH:/usr/pgsql-9.6/bin
Now when I attempt to run the requirements.txt installation it fails with this error
ImportError: No module named pytz
----------------------------------------
Cleaning up...
Command /usr/lib/ckan/default/bin/python -c "import setuptools;__file__='/usr/lib/ckan/default/build/pbr/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Aun2rR-record/install-record.txt --single-version-externally-managed --install-headers /usr/lib/ckan/default/include/site/python2.7 failed with error code 1 in /usr/lib/ckan/default/build/pbr
Storing complete log in /usr/lib/ckan/.pip/pip.log
If anybody can explain what the error means and what I need to install/modify I would greatly appreciate it. Seems there is a package called pytz missing but I cannot find information about it.
Thanks
pytz must must installed inside the virtualenv and the pip-requirements-docs.txt must be run prior to running requirements.txt.

Installing psycopg2 failed with python 3.2 but not with 3.4

First of all, I am sorry for asking a question that was asked million times, however, I couldn't resolve my issue.
TL;DR:
psycopg2 builds in Python3.4 virtualenv, but not in Python3.2; suspected dev packages missing, where can I get dev packages for old python releases?
Long story:
I should be writing code for Python3.2 using django with PostgreSQL database engine.
Ubuntu 15.04 by default ships with Python3.4 so I have build Python3.2 from source:
$ python3.2 --version
Python 3.2.6
virtualenv is created so:
myproject $ virtualenv -p python3.2 venv
New python executable in venv/bin/python3.2
Also creating executable in venv/bin/python
Installing setuptools, pip...done.
Installing requirements:
myproject $ source venv/bin/activate
(venv)myproject $ pip install psycopg2
The output log can be found in pastebin.
What I have read there:
GCC finishes whatever its doing without error messages; last non-error reporting line is
running install_lib
then it fails with
Command /home/julka/LP/myproject/venv/bin/python3.2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-cbu7a3/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-cyu65o-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/julka/LP/myproject/venv/include/site/python3.2 failed with error code 1 in /tmp/pip-build-cbu7a3/psycopg2
where it was compiling some lib.
Building with Python3.4
julka#Pyragas-vo2:~/L1P/myproject$ virtualenv -p python3.4 venv
Running virtualenv with interpreter /usr/bin/python3.4
Using base prefix '/usr'
New python executable in venv/bin/python3.4
Also creating executable in venv/bin/python
Installing setuptools, pip...done.
julka#Pyragas-vo2:~/LP/myproject$ source venv/bin/activate
(venv)julka#Pyragas-vo2:~/LP/myproject$ pip install psycopg2 --vv > psycopg2.log
Successfully installed psycopg2
Cleaning up...
(venv)julka#Pyragas-vo2:~/LP/myproject$
Successful installation. I have put the log in pastebin.
Maybe I'm missing some kind of development files for python3.2, what do i need to check this out?