The latest apt-get upgrade failed with:
Setting up python2.7-minimal (2.7.3-0ubuntu3.4) ...
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site.py", line 563, in <module>
main()
File "/usr/local/lib/python2.7/site.py", line 545, in main
known_paths = addusersitepackages(known_paths)
File "/usr/local/lib/python2.7/site.py", line 278, in addusersitepackages
user_site = getusersitepackages()
File "/usr/local/lib/python2.7/site.py", line 253, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/local/lib/python2.7/site.py", line 243, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/local/lib/python2.7/sysconfig.py", line 520, in get_config_var
return get_config_vars().get(name)
File "/usr/local/lib/python2.7/sysconfig.py", line 419, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/local/lib/python2.7/sysconfig.py", line 298, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/local/include/python2.7 /pyconfig.h (No such file or directory)
dpkg: error processing python2.7-minimal (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
python2.7-minimal
A reinstall of python2.7-minimal fails as /usr/local/include/python2.7/pyconfig.h is not found. I have alternative installs:
root#ely:~# sudo update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/python2.7 60 auto mode*
1 /usr/bin/python2.7 60 manual mode
2 /usr/bin/python3 40 manual mode
root#ely:~# whereis python
python: /usr/bin/python3.2mu /usr/bin/python2.7 /usr/bin/python2.7-config /usr/bin
/python /usr/bin/python3.2 /usr/bin/python2.7-dbg-config /usr/bin/python2.7-dbg
/etc/python2.7 /etc/python /etc/python3.2 /usr/lib/python2.7 /usr/lib/python3.2 /usr/bin
/X11/python3.2mu /usr/bin/X11/python2.7 /usr/bin/X11/python2.7-config /usr/bi/X11/python
/usr/bin/X11/python3.2 /usr/bin/X11/python2.7-dbg-config /usr/bin/X11/python2.7-dbg
/usr/local/bin/python3.2m /usr/local/bin/python2.7 /usr/local/bin/python3.2m-config
/usr/local/bin/python2.7-config /usr/local/bin/python3.2 /usr/local/bin/python3.2-config
/usr/local/lib/python2.7 /usr/local/lib/python3.2 /usr/include/python3.2mu /usr/include
/python2.7 /usr/include/python2.7_d /usr/include/python3.2 /usr/include/python3.2_d
/usr/share/python /usr/share/man/man1/python.1.gz
But pyconfig.h is only found in /usr/include/python*.*/ (as it should be?)
What is going on? How to fix (installs of other packages are affected)? Thanks.
reinstall python on ubuntu IOError: invalid Python installation: unable to open /usr/local/include/python2.7 , and then look /pyconfig.h not found , you need install this file and add it when it request you to add it
Related
I downloaded a conda package from github to bring a few modifications and would like to build this local package in a conda environment and test my changes. The problem is that the building of the recipe fails because conda has a conda.exceptions.ResolvePackageNotFound error stating that it does not detect 2 packages, snakemake and fuzzywuzzy.
Here is the meta.yaml file:
package:
name: snakepipes
version: 1.2.1
source:
path: ../
build:
number: 0
noarch: python
requirements:
build:
- python >=3
run:
- python >=3
- pandas
- graphviz
- pyyaml >=5.1
- wget
- snakemake >=5.2.3
- fuzzywuzzy
test:
commands:
- DNA-mapping --help
about:
home: 'https://snakepipes.readthedocs.org'
license: GPL3
summary: NGS processing pipelines from the MPI-IE
license_file: LICENSE.txt
I tried to change the noarch into" generic", to add "pip" in the requirements: build category...
My command line is quite standard: conda build conda-recipe/.
The error message I get is always the same:
No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Attempting to finalize metadata for snakepipes
INFO:conda_build.metadata:Attempting to finalize metadata for snakepipes
Collecting package metadata: ...working... done
Solving environment: ...working... done
BUILD START: ['snakepipes-1.2.1-py_0.tar.bz2']
Collecting package metadata: ...working... done
Solving environment: ...working... done
Collecting package metadata: ...working... done
Solving environment: ...working... failed
Leaving build/test directories:
Work:
/home/remi/anaconda3/conda-bld/work
Test:
/home/remi/anaconda3/conda-bld/test_tmp
Leaving build/test environments:
Test:
source activate /home/remi/anaconda3/conda-bld/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac
Build:
source activate /home/remi/anaconda3/conda-bld/_build_env
Traceback (most recent call last):
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/environ.py", line 753, in get_install_actions
actions = install_actions(prefix, index, specs, force=True)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/common/io.py", line 88, in decorated
return f(*args, **kwds)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/plan.py", line 473, in install_actions
txn = solver.solve_for_transaction(prune=prune, ignore_pinned=not pinned)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 107, in solve_for_transaction
force_remove, force_reinstall)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 145, in solve_for_diff
force_remove)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 242, in solve_final_state
ssc = self._run_sat(ssc)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/common/io.py", line 88, in decorated
return f(*args, **kwds)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 475, in _run_sat
conflicting_specs = ssc.r.get_conflicting_specs(tuple(final_environment_specs))
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/resolve.py", line 852, in get_conflicting_specs
reduced_index = self.get_reduced_index(specs)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/common/io.py", line 88, in decorated
return f(*args, **kwds)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/resolve.py", line 356, in get_reduced_index
specs, features = self.verify_specs(specs)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/resolve.py", line 244, in verify_specs
raise ResolvePackageNotFound(bad_deps)
conda.exceptions.ResolvePackageNotFound:
- fuzzywuzzy
- snakemake[version='>=5.2.3']
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/remi/anaconda3/bin/conda-build", line 11, in <module>
sys.exit(main())
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 456, in main
execute(sys.argv[1:])
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 447, in execute
verify=args.verify, variants=args.variants)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/api.py", line 208, in build
notest=notest, need_source_download=need_source_download, variants=variants)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 2314, in build_tree
notest=notest,
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 1397, in build
create_build_envs(m, notest)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 1281, in create_build_envs
raise e
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 1271, in create_build_envs
channel_urls=tuple(m.config.channel_urls))
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/environ.py", line 755, in get_install_actions
raise DependencyNeedsBuildingError(exc, subdir=subdir)
conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform linux-64: {"snakemake[version='>=5.2.3']", 'fuzzywuzzy'}
Do you know how to fix this ?
The problem is that you need to add conda channels that have the appropriate packages. You can search at https://anaconda.org for channels that have the packages you need.
In this case, it seems like bioconda has the snakemake package and conda-forge has fuzzywuzzy so you should be able to do
conda build -c conda-forge -c bioconda conda-recipe/
I am in the process of migrating a Django app from Heroku to Elastic Beanstalk. It is working fine in Heroku as is.
I am getting the error Your requirements.txt is invalid. Snapshot your logs for details. When I dive into the eb-activity.log I see the failure seems to be related to atlas and scipy. I don't understand why requirements.txt is invalid on aws but valid on heroku. Insight into what is causing this error and how to remedy would be greatly appreciated.
My eb-activity.log
/opt/python/run/venv/local/lib64/python3.4/site-packages/numpy/distutils/system_info.py:572: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
/opt/python/run/venv/local/lib64/python3.4/site-packages/numpy/distutils/system_info.py:572: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
self.calc_info()
/opt/python/run/venv/local/lib64/python3.4/site-packages/numpy/distutils/system_info.py:572: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
self.calc_info()
Running from scipy source directory.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ix0qk_kf/scipy/setup.py", line 416, in <module>
setup_package()
File "/tmp/pip-build-ix0qk_kf/scipy/setup.py", line 412, in setup_package
setup(**metadata)
File "/opt/python/run/venv/local/lib64/python3.4/site-packages/numpy/distutils/core.py", line 135, in setup
config = configuration()
File "/tmp/pip-build-ix0qk_kf/scipy/setup.py", line 336, in configuration
config.add_subpackage('scipy')
File "/opt/python/run/venv/local/lib64/python3.4/site-packages/numpy/distutils/misc_util.py", line 1029, in add_subpackage
caller_level = 2)
File "/opt/python/run/venv/local/lib64/python3.4/site-packages/numpy/distutils/misc_util.py", line 998, in get_subpackage
caller_level = caller_level + 1)
File "/opt/python/run/venv/local/lib64/python3.4/site-packages/numpy/distutils/misc_util.py", line 935, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "scipy/setup.py", line 15, in configuration
config.add_subpackage('linalg')
File "/opt/python/run/venv/local/lib64/python3.4/site-packages/numpy/distutils/misc_util.py", line 1029, in add_subpackage
caller_level = 2)
File "/opt/python/run/venv/local/lib64/python3.4/site-packages/numpy/distutils/misc_util.py", line 998, in get_subpackage
caller_level = caller_level + 1)
File "/opt/python/run/venv/local/lib64/python3.4/site-packages/numpy/distutils/misc_util.py", line 935, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "scipy/linalg/setup.py", line 20, in configuration
raise NotFoundError('no lapack/blas resources found')
numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
non-existing path in 'scipy/integrate': 'quadpack.h'
----------------------------------------
Command "/opt/python/run/venv/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-ix0qk_kf/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-s8me7lme-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/python/run/venv/include/site/python3.4/scipy" failed with error code 1 in /tmp/pip-build-ix0qk_kf/scipy
You are using pip version 7.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
2017-08-29 05:20:43,974 ERROR Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1
Traceback (most recent call last):
File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
install_dependencies()
File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
File "/usr/lib64/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1 (Executor::NonZeroExitStatus)
My requirements.txt:
amqp==2.1.4
apiai==1.2.3
billiard==3.5.0.2
celery==4.0.2
certifi==2017.4.17
chardet==3.0.4
DateTime==4.2
Django==1.11.2
django-eztables==0.3.2
django-hstore==1.4.2
django-tables2==1.9.0
django.js==0.8.1
djangorestframework==3.6.3
gunicorn==19.7.1
idna==2.5
kombu==4.0.2
messagebird==1.2.0
numpy==1.13.0
psycopg2==2.7.1
pytz==2017.2
requests==2.18.1
requests-toolbelt==0.8.0
urllib3==1.21.1
vine==1.1.3
virtualenv==15.1.0
whitenoise==3.3.0
zope.interface==4.4.2
gevent==1.2.1
klein==17.2.0
boto3==1.4.4
typing==3.5.3.0
future==0.16.0
six==1.10.0
jsonschema==2.6.0
tqdm==4.11.2
scipy==0.19.0
# sklearn_crfsuite
sklearn-crfsuite==0.3.5
# spacy
spacy==1.8.2
# sklearn
scikit-learn==0.18.1
# duckling
duckling==1.7.1
# cloudpickle
cloudpickle==0.2.2
# test
python-coveralls==2.9.1
pytest-pep8==1.0.6
pytest-services==1.1.14
pytest-cov==2.5.1
pytest-twisted==1.5
pytest==3.0.7
treq==17.3.1
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-1.2.0/en_core_web_sm-1.2.0.tar.gz
Note: the answer may be slightly relate to this question in which the user was having issues compiling scipy in Windows.
My django.config in .ebextensions
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: presto/wsgi.py
packages:
yum:
postgresql93: []
postgresql93-devel: []
pkgconfig: []
gcc-c++: []
python34-devel: []
It may be that I need additional dependancies in order to compile requirements.txt correctly.
You need to have a BLAS/LAPACK installed (so that atlas and atlas-dev are available on your system). See this link for instructions and try adding libblas-dev and liblapack-dev to the yum list of packages in your config file.
Whats I'll do ?
odoo#odoo-Aspire-ES1-572:~$ pip2 install pyboleto
Collecting pyboleto
Using cached pyboleto-0.3.1.tar.gz
Collecting distribute (from pyboleto)
Using cached distribute-0.7.3.zip
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/distribute.egg-info
writing requirements to pip-egg-info/distribute.egg-info/requires.txt
writing pip-egg-info/distribute.egg-info/PKG-INFO
writing top-level names to pip-egg-info/distribute.egg-info/top_level.txt
writing dependency_links to pip-egg-info/distribute.egg-info/dependency_links.txt
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-wdypyY/distribute/setup.py", line 58, in <module>
setuptools.setup(**setup_params)
File "/home/odoo/.pyenv/versions/2.7.12/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/home/odoo/.pyenv/versions/2.7.12/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/home/odoo/.pyenv/versions/2.7.12/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setuptools/command/egg_info.py", line 177, in run
writer = ep.load(installer=installer)
File "pkg_resources.py", line 2241, in load
if require: self.require(env, installer)
File "pkg_resources.py", line 2254, in require
working_set.resolve(self.dist.requires(self.extras),env,installer)))
File "pkg_resources.py", line 2471, in requires
dm = self._dep_map
File "pkg_resources.py", line 2682, in _dep_map
self.__dep_map = self._compute_dependencies()
File "pkg_resources.py", line 2699, in _compute_dependencies
from _markerlib import compile as compile_marker
ImportError: No module named _markerlib
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wdypyY/distribute/
odoo#odoo-Aspire-ES1-572:~$ pip2 install _markerlib
Invalid requirement: '_markerlib'
Traceback (most recent call last):
File "/home/odoo/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 82, in __init__
req = Requirement(req)
File "/home/odoo/.local/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "'_markerl'"
Please try the following:
sudo apt-get update # Fetches the list of available updates
sudo apt-get upgrade # Strictly upgrades the current packages
sudo apt-get dist-upgrade # Installs updates (new ones)
sudo pip install pyboleto
I'm trying to install Airflow in Ubuntu 16.04. I get an error when I try:
pip install airflow
Here is the error:
Exception:
Traceback (most recent call last):
File "/home/ashim/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/ashim/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/home/ashim/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/ashim/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/dateutil'
And I'd like to mention that you should install other package such as sasl client if you want to use more subpackages(hive, hdfs, etc)
conda install -c blaze sasl=0.2.1
conda install -c conda-forge pure-sasl=0.3.0
sudo pip install airflow
or
sudo pip install "airflow[celery,postgres]"
The second command lists the extra packages needed along with airflow.
Give permission to the "/usr/local/lib/python2.7/dist-packages/dateutil" or to the enitre /usr/local/lib
I was trying to install Django1.10 on my ubuntu 16.04 using pip install Django==1.10. Now I'm facing an error which I think is related to directories of installation path but I don't know how to get through. Here is the error:
Exception:
Traceback (most recent call last):
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/wheel.py", line 317, in clobber
ensure_dir(destdir)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/utils/init.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Django-1.10.dist-info'
Can anybody tell me what I should do to fix it? Thanks in advance.
You may need super user privilege to install a package globally. So append sudo before your command.
sudo pip install Django==1.10
Running pip as sudo is not the best of choices. That is like giving superuser access to an external application. Rather try this first:
pip install --user django==1.11