Creating Virtualenv using Anaconda Python Errors - python-2.7

I'd been working on Python distribution from Anaconda, as default. To use virtual environments, installed virtualenv. It shows that it was installed in the default location as in Anaconda. But, while creating one, it shows error. I do not understand anything as I'm not a pro. Please help. Thanks!!
avijit#avijit-Inspiron-3521:~$ virtualenv --version
15.0.3
avijit#avijit-Inspiron-3521:~$ cd Downloads/alieturklmugermany/virtualbcf/
avijit#avijit-Inspiron-3521:~/Downloads/alieturklmugermany/virtualbcf$ virtualenv bcfenv1
New python executable in /home/avijit/Downloads/alieturklmugermany/virtualbcf/bcfenv1/bin/python
Installing setuptools, pip, wheel...
Complete output from command /home/avijit/Downloa...f/bcfenv1/bin/python - setuptools pip wheel:
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
File "/home/avijit/anaconda2/lib/python2.7/tempfile.py", line 32, in <module>
import io as _io
File "/home/avijit/anaconda2/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: /home/avijit/Downloads/alieturklmugermany/virtualbcf/bcfenv1/lib/python2.7/lib-dynload/_io.so: undefined symbol: _PyCodec_LookupTextEncoding
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/home/avijit/anaconda2/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/home/avijit/anaconda2/lib/python2.7/site-packages/virtualenv.py", line 711, in main
symlink=options.symlink)
File "/home/avijit/anaconda2/lib/python2.7/site-packages/virtualenv.py", line 944, in create_environment
download=download,
File "/home/avijit/anaconda2/lib/python2.7/site-packages/virtualenv.py", line 900, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/home/avijit/anaconda2/lib/python2.7/site-packages/virtualenv.py", line 795, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/avijit/Downloa...f/bcfenv1/bin/python - setuptools pip wheel failed with error code 1

Related

Getting "No module named queue" when installing tensorflow

I am using Anaconda and trying to install tensorflow with pip, but I receive the following error and I am not sure what to do next?
Traceback (most recent call last):
File "/home/xieyangyang/anaconda3/envs/tensorflow1/bin/pip", line 7, in <module>
from pip._internal import main
File "/home/xieyangyang/anaconda3/envs/tensorflow1/lib/python2.7/site-packages/pip/_internal/__init__.py", line 20, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/home/xieyangyang/anaconda3/envs/tensorflow1/lib/python2.7/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/home/xieyangyang/anaconda3/envs/tensorflow1/lib/python2.7/site-packages/pip/_vendor/urllib3/connectionpool.py", line 44, in <module>
from .util.queue import LifoQueue
ImportError: No module named queue
Maybe just reinstall pip without pip?
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
See https://pip.pypa.io/en/stable/installing/ for more info.

ODOO 8 requires module pyboleto i can't install on python2.7.12

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

Failing to install wstools using pip on Mac OS

I'm trying to install wstools from Mac OS with this command: pip install wstools
Here's what I receive. Any ideas as to why this is happening?
Downloading/unpacking wstools
Running setup.py egg_info for package wstools
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/Users/MS/Downloads/build/wstools/setup.py", line 139, in <module>
tests_require=get_requirements(base_path, 'requirements-dev.txt'),
File "/Users/MS/Downloads/build/wstools/setup.py", line 129, in get_requirements
reqs = parse_requirements(req_path, session=False)
TypeError: parse_requirements() got an unexpected keyword argument 'session'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/Users/MS/Downloads/build/wstools/setup.py", line 139, in <module>
tests_require=get_requirements(base_path, 'requirements-dev.txt'),
File "/Users/MS/Downloads/build/wstools/setup.py", line 129, in get_requirements
reqs = parse_requirements(req_path, session=False)
TypeError: parse_requirements() got an unexpected keyword argument 'session'
----------------------------------------
Command python setup.py egg_info failed with error code 1

python virtualenv is not creating

i want to create python virtualenv with python version 2.7.6 but there is error as follow , even i wanted to reinstall pip but it showed that pip is of latest version:
$ virtualenv cow-env
New python executable in cow-env/bin/python Installing setuptools,
pip...
Complete output from command /home/cow/cow/cow-env/bin /python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/share/python-virtualenv/pip-1.5debian1-py2.py3-
none-any.whl /pip/__init__.py", line 10, in <module>
File "/usr/share/python-virtualenv/pip-1.5debian1-py2.py3-none-any.whl
/pip/util.py", line 18, in <module>
File "/usr/share/python-virtualenv/pip-1.5debian1-py2.py3-none-any.whl
/pip/_vendor/distlib/version.py", line 14, in <module>
File "/usr/share/python-virtualenv/pip-1.5debian1-py2.py3-none-any.whl
/pip/_vendor/distlib/compat.py", line 31, in <module>
ImportError: cannot import name HTTPSHandler
----------------------------------------
...Installing setuptools, pip...done.
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 3, in <module>
virtualenv.main()
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 825, in main
symlink=options.symlink)
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 993, in
create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 961, in
install_wheel
'PIP_NO_INDEX': '1'
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 903,
in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/cow/cow/cow-env/bin/python -c "import sys,pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 1
output of $pip --version is as follow:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip import main
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 60, in <module>
from pip.util import get_installed_distributions, get_prog
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 19, in <module>
from distlib import version
File "/usr/share/python-wheels/distlib-0.1.8-py2.py3-none-any.whl /distlib/version.py", line 14, in <module>
File "/usr/share/python-wheels/distlib-0.1.8-py2.py3-none-any.whl /distlib/compat.py", line 31, in <module>
ImportError: cannot import name HTTPSHandler
this issue has been resolved by reinstalling the libpython2.7-stdlib package.
sudo apt-get --reinstall install libpython2.7-stdlib
this re installation placed the missing file _ssl.so in /usr/lib/python2.7/lib-dynload.

Install tensorflow using PIP

I followed tutorial here and used PIP to install tensorflow.
GPU version is installed and my python is 2.7.12. OS is Ubuntu 14.04.
The installation step is
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc2-cp27-none-linux_x86_64.whl
sudo pip install --upgrade $TF_BINARY_URL
Installation did well with the following message
I
Installing collected packages: six, protobuf, numpy, funcsigs, pbr, mock, tensorflow
Successfully installed funcsigs-1.0.2 mock-2.0.0 numpy-1.11.2 pbr-1.10.0 protobuf-3.0.0 six-1.10.0 tensorflow-0.11.0rc2
But when I tested, I had this error.
import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/usr/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/usr/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: /usr/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so: undefined symbol: PyUnicodeUCS4_AsUTF8String
What does it mean undefined symbol: PyUnicodeUCS4_AsUTF8String and how to solve?