Virtualenv.py has no main attirute - python-2.7

I'm having trouble with my initial virtualenv setup on Mac OS 10.8.5.
After using pip to install, I have the following error when I try to run virtualenv:
ObLaDalocal:~ dbunz$ virtualenv
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
load_entry_point('virtualenv==1.11.4', 'console_scripts', 'virtualenv')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 318, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2221, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1959, in load
raise ImportError("%r has no %r attribute" % (entry,attr))
ImportError: <module 'virtualenv' from '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/py2app/recipes/virtualenv.py'> has no 'main' attribute
ObLaDalocal:~ dbunz$ echo $PYTHONPATH
/usr/local/lib/python2.7/site-packages/matplotlib:/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/py2app/recipes/

I had to burn some things to the ground, but I was able to get virtualenv to run properly.
Set up pip for multi-version mode: (sudo easy_install -m pip)
Uninstall virtualenv: sudo pip uninstall virtualenv
Reinstall virtualenv sudo pip install virtualenv
Not particularly magical.

Related

How to install django-channels in ubuntu?

I have tried to install django channels using this command.
pip install -U channels
but am getting this error
Downloading/unpacking channels Downloading
channels-2.0.2-py2.py3-none-any.whl Cleaning up... Exception:
Traceback (most recent call last): File
"/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py",
line 2482, in _dep_map
return self.dep_map File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py",
line 2344, in __getattr
raise AttributeError(attr) AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"/home/praneet/pral/myvenv/lib/python3.4/site-packages/pip/basecommand.py",
line 122, in main
status = self.run(options, args) File "/home/praneet/pral/myvenv/lib/python3.4/site-packages/pip/commands/install.py",
line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File
"/home/praneet/pral/myvenv/lib/python3.4/site-packages/pip/req.py",
line 1266, in prepare_files
req_to_install.extras): File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py",
line 2291, in requires
dm = self._dep_map File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py",
line 2484, in _dep_map
self.__dep_map = self._compute_dependencies() File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py",
line 2508, in _compute_dependencies
parsed = next(parse_requirements(distvers)) File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py",
line 2605, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec") File
"/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py",
line 2573, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:]) ValueError: ('Expected version spec in', 'asgiref ~=2.1', 'at', '
~=2.1')
Storing debug log for failure in /home/praneet/.pip/pip.log
I was also stuck with same issue.
Now,I have fixed it by installing following packages:
python2
sudo apt-get install python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev
python3
sudo apt-get install python3-dev python3-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev

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

Installation of Django on ubuntu16.04 using pip faces error

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

Creating Virtualenv using Anaconda Python Errors

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

Tweepy install Red Hat

Hi im newbie un tweepy i need install this component in my RedHat but i 'cant
Here the message:
ec2-user#ip-172-30-0-62 opitrends]$ sudo pip install tweepy
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 616, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 629, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 807, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==6.1.1
[ec2-user#ip-172-30-0-62 opitrends]$
Someone help me??
Thanks
Bruno
I can't quite tell what's going on, but that's an older version of pip and that might be the problem. Try upgrading pip:
sudo pip install --upgrade pip
and then retry.