Scrapy Installation on pyCharm - python

I am trying to install Scrapy via the project interpreter but I end with the error. Later I tried installing using pip install Scrapy but I end up with the same error. The error details are:
running build_ext
generating cffi module 'build\\temp.win-amd64-2.7\\Release\\_padding.c'
already up-to-date
generating cffi module 'build\\temp.win-amd64-2.7\\Release\\_constant_time.c'
already up-to-date
generating cffi module 'build\\temp.win-amd64-2.7\\Release\\_openssl.c'
already up-to-date
building '_openssl' extension
C:\Users\xxxx\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include "-IC:\aaaa\PC" /Tcbuild\temp.win-amd64-2.7\Release\_openssl.c /Fobuild\temp.win-amd64-2.7\Release\build\temp.win-amd64-2.7\Release\_openssl.obj
_openssl.c
build\temp.win-amd64-2.7\Release\_openssl.c(434) : fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory
error: command 'C:\\Users\\xxxx\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

You could be missing Microsoft C++ for Python 2, since the file that cannot be opened is from it.
The download is here: https://www.microsoft.com/en-us/download/details.aspx?id=44266

Related

Fail downloading cx_Freeze

I am getting this error trying to download cx_Freeze.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\BregmanM\Downloads\cx_Freeze-5.0.2>python setup.py install
running install
running bdist_egg
running egg_info
writing cx_Freeze.egg-info\PKG-INFO
writing dependency_links to cx_Freeze.egg-info\dependency_links.txt
writing top-level names to cx_Freeze.egg-info\top_level.txt
reading manifest file 'cx_Freeze.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.txt'
writing manifest file 'cx_Freeze.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
running build_ext
building 'cx_Freeze.util' extension
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\BregmanM\AppData\Local\Pro
grams\Python\Python36-32\include -IC:\Users\BregmanM\AppData\Local\Programs\Pyth
on\Python36-32\include /Tcsource/util.c /Fobuild\temp.win32-3.6\Release\source/u
til.obj
error: command 'cl.exe' failed: No such file or directory
But the problem here is I tied to fix the PATH issue and that did not work for me (python pip on Windows - command 'cl.exe' failed). I also must note, that I cannot just download using pip install because I am on a work computer that blocks me from doing so. My only option is to download the whl or tar.gz file. How can I go about fixing this? I am running on Python 3.6 so using py2exe will not work.
When I tried adding to PATH this is what I get:
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\BregmanM\AppData\Local\Programs\Python\Python36-32\include -IC:\Users\BregmanM\AppData\Local\Programs\Python\Python36-32\include /Tcsource/util.c /Fobuild\temp.win32-3.6\Release\source/util.obj
error: command 'cl.exe' failed: No such file or directory
Here is what my directory looks like:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe
I also have another 6 folders than contain cl.exe, but I'm assuming they are different. I even tried adding those to PATH but I get more errors.

Error with pip install imposm.parser, header files not found

I am using python 2.7 and I am trying to pip install imposm.parser.
The first thing I did was to install protobuf with pip install protobuf. That installed version 2.6.1 in C:\Python27\Lib\site-packages\google. Then I went here to download protoc-2.6.1-build2-windows-x86_32.exe which I renamed to protoc.exe and placed in C:\Python27\Lib\site-packages\google folder.
I then installed Microsoft Visual C++ 9.0 from here
Finally, I executed pip install imposm.parser and this is the error I get:
running build_ext
building 'imposm.parser.pbf.OSMPBF' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\imposm
creating build\temp.win-amd64-2.7\Release\imposm\parser
creating build\temp.win-amd64-2.7\Release\imposm\parser\pbf
C:\Users\Shiro\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -C:\Python27\include -IC:\Python27\PC /Tpimposm/parser/pbf/osm.cc Fobuild\temp.win-amd64-2.7\Release\imposm/parser/pbf/osm.obj
osm.cc
C:\Users\Shiro\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
c:\users\shiro\appdata\local\temp\pip-build-jel4jl\imposm.parser\imposm\parser\pbf\osm.pb.h(9) : fatal error C1083: Cannot open include file: 'google/protobuf/stubs/common.h': No such file or directory
error: command '"C:\Users\Shiro\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe"' failed with exit status 2
Edit: The header header file saying that is missing is from protobuf which I just installed with pip install protobuf. The file missing is right here in the github google/protobuf/stubs/common.h shouldn't it exist on my system since I installed with pip ? I don't understand...

Pip install portfolioopt fatal error C1083

I'm trying to install portfolioopt (Win 8.1*64) lib using pip and get those errors:
C:\Users\Alexey\AppData\Local\Programs\Common\Microsoft\Visual C++ for Pytho
n\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Anaconda\inc
lude -IC:\Anaconda\PC /Tcsrc/C/base.c /Fobuild\temp.win-amd64-2.7\Release\src/C/
base.obj
base.c
c:\users\alexey\appdata\local\temp\pip-build-30y6av\cvxopt\src\c\cvxopt.h(31
) : fatal error C1083: Cannot open include file: 'complex.h': No such file or di
rectory
error: command 'C:\\Users\\Alexey\\AppData\\Local\\Programs\\Common\\Microso
ft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status
2
I already have Visual C++ 2008 and Compiler package for python 2.7. How to fix it?
It appears that your problem is with the requirements for portfolioopt, for some reason it doesn't seem to be properly installing the cvxopt package. What I did to fix this problem (I tried and had a similar problem to you) is to separately install the cvxopt package, which I did with this command:
conda install -c https://conda.binstar.org/eswears cvxopt
after this package installed I used the pip install command for the portfolioopt package:
pip install portfolioopt
and the installation worked.

Build Python package with C bindings in Windows (VC90) causes LNK1181 fatal error

I'm trying to build a Python package (pyspotify) with bindings to a C library (libspotify).
I'm using Python 2.7.5 and have installed VS2008 Express for some required commandline tools.
When I call python setup.py build from the Command Prompt (with Admin rights) I get the following output:
running build
running build_py
running build_ext
building 'spotify._spotify' extension
And then ~18 of these, one for each .c file in the package:
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -Isrc -Ic:\Python\Python27\include -Ic:\Python\Python27\PC
/Tcsrc\module.c /Fobuild\temp.win32-2.7\Release\src\module.obj
module.c
And then the showstopper:
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo
/INCREMENTAL:NO /LIBPATH:c:\Python\Python27\libs /LIBPATH:c:\Python\Python27\PCb
uild spotify.lib /EXPORT:init_spotify build\temp.win32-2.7\Release\src\module.ob
j build\temp.win32-2.7\Release\src\session.obj build\temp.win32-2.7\Release\src\
link.obj build\temp.win32-2.7\Release\src\track.obj build\temp.win32-2.7\Release
\src\album.obj build\temp.win32-2.7\Release\src\albumbrowser.obj build\temp.win3
2-2.7\Release\src\artist.obj build\temp.win32-2.7\Release\src\artistbrowser.obj
build\temp.win32-2.7\Release\src\search.obj build\temp.win32-2.7\Release\src\pla
ylist.obj build\temp.win32-2.7\Release\src\playlistcontainer.obj build\temp.win3
2-2.7\Release\src\playlistfolder.obj build\temp.win32-2.7\Release\src\image.obj
build\temp.win32-2.7\Release\src\user.obj build\temp.win32-2.7\Release\src\pyspo
tify.obj build\temp.win32-2.7\Release\src\toplistbrowser.obj /OUT:build\lib.win3
2-2.7\spotify\_spotify.pyd /IMPLIB:build\temp.win32-2.7\Release\src\_spotify.lib
/MANIFESTFILE:build\temp.win32-2.7\Release\src\_spotify.pyd.manifest
LINK : fatal error LNK1181: cannot open input file 'spotify.lib'
error: command '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.
exe"' failed with exit status 1181
And I have tried to search for this LNK1181 error, but all answers seems to be about remembering quotes around string, or some settings in VS which I in this case has no control over.
You need to download the appropriate version of libspotify from here unzip it and put it in the same directory that you are trying to build in, (easiest place), or tell VS where to find it.

Exception while installing packages in Python

I am Getting this Exception while installing packages in Python.
uninstalled python and installed it again but there is no
C:\Users\ramasastri.g\Desktop\pycrypto-2.6>python setup.py install
running install
running build
running build_py
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Random.OSRNG.winrandom' extension
C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc/ -Isrc/inc-msvc/ -IC:\Python27\include -IC:\Python27\PC /Tcsrc/winrand.c /Fobuild\temp.win32-2.7\Release\src/winrand.obj
winrand.c
c:\python27\include\pyconfig.h(68) : fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe"' failed with exit status 2
Probably you are missing the c++ compiler.
I installed it using a pre-packaged version from here
My problem was inside a virtualenv. I could not install some packages and got the same fatal error c1083. I was trying Visual Studio and PTVS. Just installing Microsoft Visual C++ Compiler for Python 2.7 https://www.microsoft.com/en-us/download/details.aspx?id=44266 was not enough to fix the error, despite it is needed.
I have found the solution here http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/
The setuptools installed by virtualenv is too old (3.6). You need to remove it and reinstalling but, in the "Install python package" window in Visual Studio solution explorer, instead of using "setuptools" as the module name to install use "setuptools>=6.0".
Got the same error message and found the cause was that while I had set up the PATH variable correctly with the paths to Visual Studio and Python, I forgot to add the C:\Windows\System32 path.

Categories