My python version is 2.7. I tried to install pyjags using pip install pyjags but got such error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags/setup.py", line 68, in <module>
add_jags(ext)
File "/private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags/setup.py", line 46, in add_jags
version = add_pkg_config(ext, 'jags')
File "/private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags/setup.py", line 34, in add_pkg_config
output = subprocess.check_output(args)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags
I just deployed a python package and had same errors when I tried to install via pip. Turns out the main reasons was that the project artifacts (static files, etc) were not included in the MANIFEST file or it couldn't load a file path. I think you might want to consult the documentation here.
The line below was copied from the docs:
The setup.py script uses pkg-config to locate the JAGS library. If JAGS is installed in some non-standard location, then you may need to configure pkg-config to pick up correct metadata file. For example, if JAGS have been configured with --prefix=/opt/, then JAGS metadata file would be located in /opt/lib/pkgconfig/. This path can be included in pkg-config search path as follows:
export PKG_CONFIG_PATH=/opt/lib/pkgconfig/:$PKG_CONFIG_PATH
From your track trace, it seems like you failed to configure that.
pip is not a supported installation method. Read the installation instructions on the website enter link description here.
Related
I try to install ctcdecode on ubuntu 18.04, but it is not easy.
First, I clone the repository to my server and error occurs when I 'pip install .' at the cloned root repository.
It is the guideline for installation.
git clone --recursive https://github.com/parlance/ctcdecode.git
cd ctcdecode && pip install .
Here is my error message
Processing /home/skgudwn34/ctcdecode
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-7zcjual1/setup.py", line 30, in <module>
'third_party/boost_1_67_0.tar.gz')
File "/tmp/pip-req-build-7zcjual1/setup.py", line 22, in download_extract
tar.extractall('third_party/')
File "/home/skgudwn34/anaconda3/envs/pytorch/lib/python3.7/tarfile.py", line 2000, in extractall
numeric_owner=numeric_owner)
File "/home/skgudwn34/anaconda3/envs/pytorch/lib/python3.7/tarfile.py", line 2042, in extract
numeric_owner=numeric_owner)
File "/home/skgudwn34/anaconda3/envs/pytorch/lib/python3.7/tarfile.py", line 2112, in _extract_member
self.makefile(tarinfo, targetpath)
File "/home/skgudwn34/anaconda3/envs/pytorch/lib/python3.7/tarfile.py", line 2161, in makefile
copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
File "/home/skgudwn34/anaconda3/envs/pytorch/lib/python3.7/tarfile.py", line 247, in copyfileobj
buf = src.read(bufsize)
File "/home/skgudwn34/anaconda3/envs/pytorch/lib/python3.7/gzip.py", line 287, in read
return self._buffer.read(size)
File "/home/skgudwn34/anaconda3/envs/pytorch/lib/python3.7/_compression.py", line 68, in readinto
data = self.read(len(byte_view))
File "/home/skgudwn34/anaconda3/envs/pytorch/lib/python3.7/gzip.py", line 493, in read
raise EOFError("Compressed file ended before the "
EOFError: Compressed file ended before the end-of-stream marker was reached
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-7zcjual1/
I search solution for days.
Many people recommend upgrading setuptools, but it didn't work.
How can I do to resolve my problem.
Please help. I look forward to your comment.
Thanks in advance.
This is likely because of an incomplete download of the boost_1_67_0.tar.gz file, as is indicated by the error message: EOFError: Compressed file ended before the end-of-stream marker was reached.
I would recommend downloading the boost file from here and replacing the ctcdecode/third_party/boost_1_67_0.tar.gz file with the complete, downloaded one. Let me know if that works!
Edit: Might be worth it to download the openfst tar as well from here and replacing the one in third_party/ as well.
I'm trying to install pmdarima package in a conda env as it requires statsmodels <0.12 and I would also like to use statmodels latest release for this project. My understanding is limited, but I first tried
conda skeleton pypi pmdarima
This failed with the same AttributeError related to numpy disutils described below.
Similarly to the questioner in this question: Conda skeleton pypi: ModuleNotFoundError: No module named 'numpy' I was unable to get this to work either.
conda install -n _build numpy
I then tried the advice laid out in the above-linked SO question and ran:
conda skeleton pypi --extra-specs numpy pmdarima
This results in pretty long output but the key piece as far as I can tell is:
Applying patch: '/var/folders/7f/8d7rz34522gcq4z774n9v91r0000gn/T/tmp8tv1gdnxconda_skeleton_pmdarima-1.7.1.tar.gz/pypi-distutils.patch'
patching file core.py
Hunk #1 succeeded at 168 with fuzz 2 (offset 1 line).
Partial import of pmdarima during the build process.
Requirements: ['joblib>=0.11', 'Cython>=0.29,<0.29.18', 'numpy>=1.17.3', 'pandas>=0.19', 'scikit-learn>=0.22', 'scipy>=1.3.2', 'statsmodels>=0.11,<0.12', 'urllib3', 'setuptools<50.0.0']
Setting up with numpy.distutils.core
Traceback (most recent call last):
File "setup.py", line 324, in <module>
do_setup()
File "setup.py", line 320, in do_setup
setup(**metadata)
File "/opt/anaconda3/conda-bld/skeleton_1599410605346/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.7/site-packages/numpy/distutils/core.py", line 130, in setup
if dist.help or not _command_line_ok():
AttributeError: 'NoneType' object has no attribute 'help'
$PYTHONPATH = /var/folders/7f/8d7rz34522gcq4z774n9v91r0000gn/T/tmp8tv1gdnxconda_skeleton_pmdarima-1.7.1.tar.gz/pmdarima-1.7.1
Leaving build/test directories:
Work:
/opt/anaconda3/conda-bld/skeleton_1599410605346/work
Test:
/opt/anaconda3/conda-bld/skeleton_1599410605346/test_tmp
Leaving build/test environments:
Test:
source activate /opt/anaconda3/conda-bld/skeleton_1599410605346/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place
Build:
source activate /opt/anaconda3/conda-bld/skeleton_1599410605346/_build_env
Error: command failed: /opt/anaconda3/conda-bld/skeleton_1599410605346/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/bin/python setup.py install
Any ideas? Thank you so much in advance, very much appreciated!
Not sure what the proper resolution is for the NumPy-based build, but the setup.py does check for an sdist argument, which branches to use setuptools for the build instead of numpy. Hence, the following seems to avoid the code causing the issue:
conda skeleton pypi --setup-options sdist pmdarima
I suspect the downside to this workaround is that there is no Cython compilation done, but not totally sure.
You may want to file an issue on the pmdarima GitHub to see if any of the devs have ideas. Otherwise, it might just be more efficient to pip install the package in the environment you want it (as long as that environment is not base).
#merv thank you for your help! Interestingly, this works for the skeleton, but fails when running conda-build with the following (truncated until the errors) output:
0 location(s) to search for versions of sdist:
Given no hashes to check 0 links for project 'sdist': discarding no candidates
ERROR: Could not find a version that satisfies the requirement sdist (from versions: none)
ERROR: No matching distribution found for sdist
Exception information:
Traceback (most recent call last):
File "$PREFIX/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 216, in _main
status = self.run(options, args)
File "$PREFIX/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
return func(self, options, args)
File "$PREFIX/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 325, in run
reqs, check_supported_wheels=not options.target_dir
File "$PREFIX/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "$PREFIX/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 388, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "$PREFIX/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 339, in _get_abstract_dist_for
self._populate_link(req)
File "$PREFIX/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 305, in _populate_link
req.link = self._find_requirement_link(req)
File "$PREFIX/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 270, in _find_requirement_link
best_candidate = self.finder.find_requirement(req, upgrade)
File "$PREFIX/lib/python3.7/site-packages/pip/_internal/index/package_finder.py", line 928, in find_requirement
req)
pip._internal.exceptions.DistributionNotFound: No matching distribution found for sdist
Removed build tracker: '/private/tmp/pip-req-tracker-umxriyi2'
Traceback (most recent call last):
File "/opt/anaconda3/bin/conda-build", line 11, in <module>
sys.exit(main())
File "/opt/anaconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 474, in main
execute(sys.argv[1:])
File "/opt/anaconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 465, in execute
verify=args.verify, variants=args.variants)
File "/opt/anaconda3/lib/python3.7/site-packages/conda_build/api.py", line 210, in build
notest=notest, variants=variants)
File "/opt/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 3036, in build_tree
notest=notest,
File "/opt/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 2155, in build
cwd=src_dir, stats=build_stats)
File "/opt/anaconda3/lib/python3.7/site-packages/conda_build/utils.py", line 407, in check_call_env
return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)
File "/opt/anaconda3/lib/python3.7/site-packages/conda_build/utils.py", line 387, in _func_defaulting_env_to_os_environ
raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['/bin/bash', '-o', 'errexit', '/opt/anaconda3/conda-bld/pmdarima_1599500058832/work/conda_build.sh']' returned non-zero exit status 1.
I'll confess we're well above my head at this point, (do I need to edit the meta.yaml file somehow? Is that crazy?) but will try opening an issue as you suggested, once again really appreciate it.
Running on Ubuntu 16.04, Python 3.6.2
I have successfully used this package before. In fact, it works on a different pc but not the one I need it to work on.
https://pypi.python.org/pypi/pandas_access
import pandas_access as mdb
df = mdb.read_table("myDatabase", "myTable")
Traceback (most recent call last):
File "", line 1, in
File "/home/nfw/anaconda3/lib/python3.6/site-packages/pandas_access/init.py", line 118, in read_table schemas = to_pandas_schema(read_schema(rdb_file, schema_encoding),
File "/home/nfw/anaconda3/lib/python3.6/site-packages/pandas_access/init.py", line 59, in read_schema output = subprocess.check_output(['mdb-schema', rdb_file])
File "/home/nfw/anaconda3/lib/python3.6/subprocess.py", line 336, in check_output **kwargs).stdout
File "/home/nfw/anaconda3/lib/python3.6/subprocess.py", line 403, in run with Popen(*popenargs, **kwargs) as process:
File "/home/nfw/anaconda3/lib/python3.6/subprocess.py", line 707, in init restore_signals, start_new_session)
File "/home/nfw/anaconda3/lib/python3.6/subprocess.py", line 1333, in _execute_child raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'mdb-schema'
The code for pandas_access is available here
https://github.com/jbn/pandas_access/blob/master/pandas_access/init.py
It's supposed to only require MDB Tools which I have installed and it works. I can open the access database using MDB Tools on its own.
Solved!
I ran mdb-schema on the command line of the working pc and got:
Usage: mdb-schema [options] []
where options are:
-T Only create schema for named table
-N Prefix identifiers with namespace
I rant mdb-schema on the non-working pc and got:
The program 'mdb-schema' is currently not installed. You can install it by typing:
sudo apt install mdbtools
Not sure how I this wasn't installed as I was running gmdb2 on it for sure before this but oh well, need to move on.
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.
EDIT2: OK this is weird. (I can't answer my own question, so I just put it as another edit to the question. I think it has something to do with the fact that I tried to do this installation within a Dropbox-synced directory. I got this to work on my Desktop. Can anyone explain why this is the case?
Original question:
I'm trying to do Heroku's Python setup tutorial (http://devcenter.heroku.com/articles/python), on my Mac OS X (Lion), but I get caught up with the step of creating a virtualenv.
So what I did was this in the command line (not using sudo caused permissions error):
sudo pip install virtualenv
But then, when I do "virtualenv venv --distribute" (I also tried with sudo), I get the following error:
New python executable in venv/bin/python
Installing distribute..............................................................................................................................................................................................................................................................................................done.
Installing pip...
Error [Errno 2] No such file or directory while executing command /Users/AndyFang/Drop...env/bin/easy_install /Library/Python/2.7/...pport/pip-1.1.tar.gz
...Installing pip...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
load_entry_point('virtualenv==1.7.1.2', 'console_scripts', 'virtualenv')()
File "/Library/Python/2.7/site-packages/virtualenv.py", line 928, in main
never_download=options.never_download)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 1042, in create_environment
install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 640, in install_pip
filter_stdout=_filter_setup)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 966, 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__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Not really sure what to do. It seemed like I didn't have easy_install on my Mac, but I do have it... I'm not sure what the deal is?
EDIT: I also just tried installing virtualenv with easy_install, but I get the exact same error.
If your problem is the same as mine, then it's because there's a space somewhere in the path to your Dropbox-synced folder.
Virtualenvs aren't portable, so you can't keep them synced across multiple machines if the paths don't match up.
In general, it's a bad idea :)