pip - unable to find vcvarsall.bat - python

From last week, I tried to solve this but couldn't fix this error. While, I tried to install, following error comes:
C:\Users\#######>pip install pyproj
Collecting pyproj
Using cached pyproj-1.9.5.1.tar.gz
Complete output from command python setup.py egg_info:
using bundled proj4..
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\H~1\AppData\Local\Temp\pip-build-e4o66o1z\pyproj\setup.py", line 72, in <module>
objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
File "C:\Users\######\Anaconda3\lib\distutils\_msvccompiler.py", line 317, in compile
self.initialize()
File "C:\Users\########\Anaconda3\lib\distutils\_msvccompiler.py", line 210, in initialize
vc_env = _get_vc_env(plat_spec)
File "C:\Users\#######\Anaconda3\lib\distutils\_msvccompiler.py", line 85, in _get_vc_env
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\H~1\AppData\Local\Temp\pip-build-e4o66o1z\pyproj\
I couldn't proceed ahead without fixing this error. I have installed Microsoft Visual C++.

Installing some Python packages under Windows can be troublesome. You can find a precompiled package at
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyproj
Just download the .whl file that suits your Python version then install it using
pip install <filename>.whl

Related

installing python module on linux

I am trying to install the python module pyobjus (this is the one that fails to install another module).
But I always get some bug during installation. I tried to switch to other python versions, reinstall pip, use option --no-cache-dir, etc, but couldn't manage to get past this bug:
$ pip3 install pyobjus
Defaulting to user installation because normal site-packages is not writeable
Collecting pyobjus
Using cached pyobjus-1.2.0.tar.gz (165 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf
cwd: /tmp/pip-install-4k26drr5/pyobjus
Complete output (19 lines):
Pyobjus platform is linux
Traceback (most recent call last):
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 150, in get_requires_for_build_wheel
config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 130, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 254, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 35, in <module>
class PyObjusBuildExt(build_ext, object):
NameError: name 'build_ext' is not defined
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf Check the logs for full command output.
Any help would be greatly appreciated.
My OS is Linux Mint 19.3.
I saw this question which is about the same problem, but following the links did not bring any answer. It says PyObjus is designed for MacOS, but then why does the module katrain, supposedly compatible with linux, tries to install it when running "pip3 install katrain" (giving the same error as above) ?
Edit adter Marat's suggestion:
I removed the test for ios, the installation goes a bit further, but fails because Python.h is missing. when trying to install python3-dev, apt-get says that broken packages such as python3.6-dev are flagged "left as is", so it cannot install the required ones. Is there a way to fix the python installation, which seems to be broken ? I am afraid to break all the system if I mess up with it too much, but there is clearly a problem with my installation...
Fixed the above issue by reinstalling stuff, now it is CoreFoundation.h that is missing...

Unable to install libxml2 and lxml on pypy - python 2.7

I know there were many, many questions asked about installing lxml but I could not find anything that solves my problem. If I missed an answer, please refer me to it.
I'll try to give you as much as information as I can think of.
So I'm trying to install lxml .
I run on windows 10, platform.uname() output is:
import platform
platform.uname()
('Windows', 'DESKTOP-6AH7RBF', '10', '10.0.15063', 'AMD64', 'Intel64 Family 6 Model 142 Stepping 9, GenuineIntel')
And my interpreter is pypy:
import sys
sys.version
'2.7.13 (14f400f0498e, Mar 31 2017, 19:58:36)\n[PyPy 5.7.1 with MSC v.1500 32 bit]'
setuptools version is 36.2.7
When ran the pip command, got this output:
C:\WINDOWS\system32>c:\pypy27\bin\pip.exe install c:\Users\Jack\Downloads\lxml-cffi.zip
Processing c:\users\jack\downloads\lxml-cffi.zip
Complete output from command python setup.py egg_info:
Building lxml version 3.4.0.
Building without Cython.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt _cffi__gf1d3c271xb1c86544.c
src\lxml-cffi\includes\__pycache__\_cffi__gf1d3c271xb1c86544.c(53) : fatal error C1083: Cannot open include file: 'libxml/chvalid.h': No such file or directory
Traceback (most recent call last):
File "<module>", line 1, in <module>
File "c:\users\jack\appdata\local\temp\pip-twwxp3-build\setup.py", line 232, in <module>
**setup_extra_options()
File "c:\users\jack\appdata\local\temp\pip-twwxp3-build\setup.py", line 145, in setup_extra_options
STATIC_CFLAGS, STATIC_BINARIES)
File "setupinfo.py", line 167, in ext_modules
import lxml.etree
File "src\lxml\../lxml-cffi\etree.py", line 8, in <module>
from .apihelpers import _assertValidNode, _assertValidDoc
File "src\lxml\../lxml-cffi\apihelpers.py", line 3, in <module>
from .includes.etree_defs import _isString, _getNs, _isElement
File "src\lxml\includes\../../lxml-cffi/includes\etree_defs.py", line 1, in <module>
from . import tree
File "src\lxml\includes\../../lxml-cffi/includes\tree.py", line 498, in <module>
libraries=['xml2'])
File "C:\pypy27\lib_pypy\cffi\api.py", line 438, in verify
lib = self.verifier.load_library()
File "C:\pypy27\lib_pypy\cffi\verifier.py", line 114, in load_library
self._compile_module()
File "C:\pypy27\lib_pypy\cffi\verifier.py", line 211, in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
File "C:\pypy27\lib_pypy\cffi\ffiplatform.py", line 20, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "C:\pypy27\lib_pypy\cffi\ffiplatform.py", line 56, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
VerificationError: CompileError: command 'C:\\Users\\Jack\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\jack\appdata\local\temp\pip-twwxp3-build\
As the error and the lxml docs say, I need to install first libxml2 and libxslt . So I entered the download page of libxml2 and downloaded the latest version - 2.9.4
And ran pip install on the downloaded tar.gz:
C:\WINDOWS\system32>c:\pypy27\bin\pip.exe install c:\Users\Jack\Downloads\libxml2-2.9.4.tar.gz
Processing c:\users\jack\downloads\libxml2-2.9.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<module>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'c:\\users\\jack\\appdata\\local\\temp\\pip-4ww1fs-build\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\jack\appdata\local\temp\pip-4ww1fs-build\
Did the same for versions 2.9.3 and 2.9.2 and got similar results.
What am I missing? How can I fix it so I can install lxml?
Thanks in advance for all of those involved!

Python pip install fails with error

I have been trying to install yajl>=0.3.5 package and i get the following error. This happens for only this specific package and not for others i am currently using. The command is as follows.
pip install yajl>=0.3.5
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\ANURAG~1\AppData\Local\Temp\pip-build-epamw9qh\yajl\
Alternatively
I know there is a similar question asked and have tried all specified solutions in the mentioned question. Here are my findings.
1) I have successfully installed setuptools,upgraded them and also installed ez_setup. pip install yajl>=0.3.5 gives the same error as above even after this.
2) I have downloaded the source code of yajl>=0.3.5 and tried the following command.
cd yajl && python setup.py bdist_wheel
the error i get is as below.
Collecting yajl>=0.3.5
Using cached yajl-0.3.5.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ANURAG~1\AppData\Local\Temp\pycharm-packaging\yajl\setup.py",
line 64, in
subprocess.call(['git', 'submodule', 'update',])
File "C:\Program Files\Python\lib\subprocess.py", line 560, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Program Files\Python\lib\subprocess.py", line 950, in init
restore_signals, start_new_session)
File "C:\Program Files\Python\lib\subprocess.py", line 1220, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\ANURAG~1\AppData\Local\Temp\pycharm-packaging\yajl\
PS: I am using windows 10.

Command "python setup.py egg_info" failed with error code 1

Extracting in C:\Users\hkpra\AppData\Local\Temp\tmp3esvodcb
Traceback (most recent call last):
File "c:\program files\python35\lib\site-packages\ez_setup.py", line 143, in use_setuptools
raise ImportError
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\hkpra\AppData\Local\Temp\pip-build-imphcwak\unroll\setup.py", line 2, in <module>
ez_setup.use_setuptools()
File "c:\program files\python35\lib\site-packages\ez_setup.py", line 145, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "c:\program files\python35\lib\site-packages\ez_setup.py", line 125, in _do_download
_build_egg(egg, tarball, to_dir)
File "c:\program files\python35\lib\site-packages\ez_setup.py", line 99, in _build_egg
_extractall(tar)
File "c:\program files\python35\lib\site-packages\ez_setup.py", line 467, in _extractall
self.chown(tarinfo, dirpath)
TypeError: chown() missing 1 required positional argument: 'numeric_owner'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\hkpra\AppData\Local\Temp\pip-build-imphcwak\unroll\
These are the things you need to do to fix this error when installing python. Make sure to follow in accordance.
check if PIP and setuptools are installed.
upgrade PIP and setuptools.
install ez_setup.
Should you want step by step guidance on how to go about it, you can go here.
install python again, then successed
I also install by pip,lick
pip install locustio
or
sudo pip install locustio
but error occur
Collecting locustio
Using cached locustio-0.7.5.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
error: Invalid distribution name or version syntax: locustio-0.7.5
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/yw/15gswkd13v37xjqjy66rc8xc0000gn/T/pip-build-hFFjxs/locustio/
I try pip, pip3, and so on. Finally, I install python again and then it is ok.
for python2.7
sudo pip install python
for python3
sudo pip install python3

Installing Python Packages - IronPython

I'd like to add the PRAW package to an IronPython solution in VS however it's proving to be a pain in the butt. Here are steps I'm taking
right-click on IronPython Environment, select install python package.
type in "Praw" using pip
I get a prompt telling me that pip needs to get installed.
I then see the following:
Installing 'pip' package manager.
Downloading distribute from https://go.microsoft.com/fwlink/?LinkID=306663
Installing from distribute-0.6.45
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at c:\program files (x86)\ironpython 2.7\lib\site-packages\setuptools-0.6c11-py2.7.egg
Egg installation
Already patched.
running install
Traceback (most recent call last):
File "setup.py", line 147, in <module>
File "C:\Program Files (x86)\IronPython 2.7\Lib\distutils\core.py", line 151, in setup
File "C:\Program Files (x86)\IronPython 2.7\Lib\distutils\dist.py", line 952, in run_commands
File "C:\Program Files (x86)\IronPython 2.7\Lib\distutils\dist.py", line 971, in run_command
File "c:\users\mj\appdata\local\temp\ptvs-9jvsvw-pip_downloader\distribute-0.6.45\setuptools\command\install.py", line 63, in run
AttributeError: 'module' object has no attribute '_getframe'Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\pip_downloader.py", line 47, in <module>
File "C:\Program Files (x86)\IronPython 2.7\Lib\subprocess.py", line 512, in check_call
subprocess.CalledProcessError: Command '['C:\\Program Files (x86)\\IronPython 2.7\\ipy64.exe', 'setup.py', 'install']' returned non-zero exit status 1
'pip' failed to install. Exit code: 1
With the reason for the failed install being: AttributeError: 'module' object has no attribute '_getframe'Traceback (most recent call last):
How do I get around this? Is there a way to install pip and for ironpython in a different manner? Is there a way to install packages/libraries by not having to use pip? I can install the package just fine via Pip for python 2.7.
You have to run IronPython with the command line option -X:FullFrames. I'm not sure, though, how to set that up in the VS.
Maybe you can manually run it:
C:\path\to\ipy64.exe -X:FullFrames path\to\pip.py install whaterver_you_want

Categories