I have some trouble installing llvmpy on ubuntu 14.04, i downloaded llvmpy from llvmpy.org and installed llvm 3.4 via apt-get, when I try to install it using
python setup.py install
I get this error:
Error: could not invoke ['llvm-config', '--version']
Try setting LLVM_CONFIG_PATH=/path/to/llvm-config
Then i used
LLVM_CONFIG_PATH=/usr/lib/llvm-3.4/bin/llvm-config python setup.py install
and i got
LLVM version = u'3.4'
LLVM targets =
Generate intrinsic IDs
Searching shared library libLLVM-3.4 in /usr/lib/llvm-3.4/lib
Using dynamic linking
/usr/bin/python: can't open file 'llvmpy/build.py': [Errno 2] No such file or directory
Traceback (most recent call last):
File "setup.py", line 142, in <module>
check_call([sys.executable, 'llvmpy/build.py'])
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python',
'llvmpy/build.py']' returned non-zero exit status 2
How can I solve this?
If you got it from the tar.gz file available at https://pypi.python.org/packages/source/l/llvmpy/llvmpy-0.12.4.tar.gz , it is incomplete, try download as a zip from github https://github.com/llvmpy/llvmpy
Or directly via git commands
Related
i was using python today and needed to update pip. I ran the standard python -m pip --upgrade install pip command as system admin but now pip can't do anything and gives a quite bizarre error message:
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 253, in run
options.use_user_site = decide_user_install(
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 604, in decide_user_install
if site_packages_writable(root=root_path, isolated=isolated_mode):
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 548, in site_packages_writable
return all(
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 549, in <genexpr>
test_writable_dir(d) for d in set(get_lib_location_guesses(**kwargs))
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\utils\filesystem.py", line 140, in test_writable_dir
return _test_writable_dir_win(path)
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\utils\filesystem.py", line 153, in _test_writable_dir_win
fd = os.open(file, os.O_RDWR | os.O_CREAT | os.O_EXCL)
PermissionError: [Errno 13] Permission denied: 'c:\\program files (x86)\\python38-32\\Lib\\site-packages\\accesstest_deleteme_fishfingers_custard_al9l45'
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the 'c:\program files (x86)\python38-32\python.exe -m pip install --upgrade pip' command.
this is the output if I run any pip updating or even just calling pip install on any package. the referenced file mentioned at the end does not seem to exist on my PC. does anyone know what it is?
PS I have tried running command prompt and PowerShell as both admin and normal user and each time get this exact error
I'm trying to configure 2 Ubuntu servers to use Python and Tensorflow for my project. I finished the 1st server, however, there are some very unusual and annoying errors with the 2nd one. This is the log when I run pip check on the 1st server:
~$: pip check
No broken requirements found.
And the error log on the 2nd one:
~$: pip check
No broken requirements found.
Traceback (most recent call last):
File "/home/mju-hpc-02/.local/bin/pip", line 11, in <module>
sys.exit(main())
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/__init__.py", line 233, in main
return command.main(cmd_args)
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/basecommand.py", line 251, in main
timeout=min(5, options.timeout)) as session:
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/basecommand.py", line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/download.py", line 329, in __init__
self.headers["User-Agent"] = user_agent()
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/download.py", line 93, in user_agent
from pip._vendor import distro
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/_vendor/distro.py", line 1050, in <module>
_distro = LinuxDistribution()
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/_vendor/distro.py", line 594, in __init__
if include_lsb else {}
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/_vendor/distro.py", line 931, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero
exit status 1
This error also shows everytime I'm trying to install a new package with pip. Anyone faced similar problems with pip or having a way to diagnose the error?
EDIT 1:
As languitar suggestion, I ran lsb_release -a on both machines and this is the log on the 1st one:
~$: lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
2nd one:
~$: lsb_release -a
Traceback (most recent call last):
File "/usr/bin/lsb_release", line 25, in <module>
import lsb_release
ImportError: No module named 'lsb_release'
You did not mention your Python version(s) available on your system.
Not sure how this happen, but often 'lsb_version' is available to run on python v2 and others on v3.
Most likely you have a multiple python version on your host.
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero
exit status 1
Is, indeed, failing because the 'lsb_release' library called by '/usr/bin/lsb_release' is not available for your particular Python version.
Your first attempt to fix this is simple:
sudo apt install lsb-release
Note is '-' and not '_'
Try again, if keep failing try the following: Look for your Python version library on /usr/lib, and confirm that 'lsb_release.py' is not there. Then, link the shared version to your library:
ln -sfv /usr/share/pyshared/lsb_release.py /usr/lib/python3.7/site-packages/lsb_release.py
Last resource, search /usr for any lsb_release.py and link it to your Python library.
find /usr -name lsb_release.py
You can just use default lsb_release or perhaps a bit modified version:
1 #!/bin/bash
171 [ -z "$LSB_VERSION" ] && LSB_VERSION="1.4"
172 #$MSG_NA
It seems your lsb_release binary is broken. Try to reinstall lsb-release (ubuntu or debian package).
I am trying to install the rpy2 package from Anaconda 2.
Pip found rpy2 and downloaded but then it gave me the following output resulting in an error message:
C:\Users\ALEX\Anaconda2\Scripts>pip install rpy2
Collecting rpy2
Using cached rpy2-2.8.5.tar.gz
Complete output from command python setup.py egg_info:
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.
'sh' is not recognized as an internal or external command,
operable program or batch file.
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
C:\PROGRA~1\R\R-33~1.2\bin\x64\R CMD config --ldflags
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\alex\appdata\local\temp\pip-build-p9qyoo\rpy2\setup.py", line 331, in <module>
ri_ext = getRinterface_ext()
File "c:\users\alex\appdata\local\temp\pip-build-p9qyoo\rpy2\setup.py",
line 238, in getRinterface_ext
ldf = shlex.split(' '.join(rexec.cmd_config('--ldflags')))
File "c:\users\alex\appdata\local\temp\pip-build-p9qyoo\rpy2\setup.py",
line 191, in cmd_config
universal_newlines = True)
File "C:\Users\ALEX\Anaconda2\lib\subprocess.py", line 574, in
check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '('C:\\PROGRA~1\\R\\R-
33~1.2\\bin\\x64\\R', 'CMD', 'config', '--ldflags')' returned non-zero
exit status 1
----------------------------------------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
c:\users\alex\appdata\local\temp\pip-build-p9qyoo\rpy2\
I researched about this error message in stackoverflow and I found some advice. E.g. download and run the ez_setup.py script ( Can't install via pip because of egg_info error) I did it but it had no effect.
Your advice will be appreciated.
I've downloaded PyTesser and extracted it.
I was in the pytesser_v0.0.1 folder and tried to run the sample usage code in the python interpreter:
from pytesser import *
print image_file_to_string('fnord.tif')
and the output:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pytesser.py", line 44, in image_file_to_string
call_tesseract(filename, scratch_text_name_root)
File "pytesser.py", line 21, in call_tesseract
proc = subprocess.Popen(args)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
NOTE: I'm in Ubuntu 12.10 with Python 2.7.3
can anyone help me understand this error, and what can I do to fix it ?
This isn't as well documented as it could be, but if you are not on Windows you need to install the tesseract binary for your platform. On Ubuntu and other Debian based Linux distributions, apt-get install tesseract-ocr. Then you can run:
python pytesser.py
which uses the test files phototest.tif, fnord.tif and fonts_test.png to test the library.
For beginners on windows to use pytesseract:
Open command prompt
Type: pip install pytesseract
(this will install pytesseract last version module on your python easily)
Go to this link and download and install tesseract-ocr engine:
https://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-ocr-setup-3.02.02.exe&can=2&q=
Now you are ready to use pytesseract
For more information and see code example check this link:
http://www.manejandodatos.es/2014/11/ocr-python-easy/
Trying to use virutalenv version 1.6.4 (the latest at writing this post) on 10.7, Lion with yes Xcode 4 installed from mac app store, yet i'm getting the below error message:
New python executable in SUPENV/bin/python
Error [Errno 2] No such file or directory while executing command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python #executable_path/../.Python SUPENV/bin/python
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
load_entry_point('virtualenv==1.6.4', 'console_scripts', 'virtualenv')()
File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 810, in main
never_download=options.never_download)
File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 901, in create_environment
site_packages=site_packages, clear=clear))
File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 1166, in install_python
py_executable])
File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 843, in call_subprocess
cwd=cwd, env=env)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
OSError: [Errno 2] No such file or directory
Any hints on how to solve this problem... I guess the first would be to check if install_name_tool is present on my system, and then force virtualenv to use it...
thanks in advance!
You need to both install XCode, run it, and select the optional "command line tools" package and then install those. In more detail:
Download XCode from the App Store
Run the downloaded XCode binary from Applications or Launchpad
Select XCode->Preferences, then choose the "Downloads" tab
Click on the "Command Line Tools" selection and install those
Did you actually install Xcode 4? Downloading it from the App Store only downloads the installer for it. Then you need to run the installer; you should find the installer downloaded to /Applications. After you run it, you should find install_name_tool here:
$ which install_name_tool
/usr/bin/install_name_tool
With newer versions of virtualenv (at least from 1.8.4 on) it is no longer necessary to install the "Command Line Tools" package from Xcode.