I'm trying to install virtualenvwrapper on a fresh Ubuntu 14.04 installation. I followed the steps here and added these lines to my .bashrc:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
I get the following error message when I try and source ~/.bashrc:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/virtualenvwrapper/hook_loader.py", line 217, in <module>
main()
File "/usr/local/lib/python2.7/dist-packages/virtualenvwrapper/hook_loader.py", line 131, in main
run_hooks(hook, options, args)
File "/usr/local/lib/python2.7/dist-packages/virtualenvwrapper/hook_loader.py", line 157, in run_hooks
hook_mgr = ExtensionManager(namespace)
File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 92, in __init__
verify_requirements)
File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 155, in _load_plugins
for ep in self._find_entry_points(self.namespace):
File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 148, in _find_entry_points
eps = list(pkg_resources.iter_entry_points(namespace))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 515, in iter_entry_points
entries = dist.get_entry_map(group)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2371, in get_entry_map
self._get_metadata('entry_points.txt'), self
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2155, in parse_map
for group, lines in data:
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2715, in split_sections
for line in yield_lines(s):
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in yield_lines
for ss in strs:
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2305, in _get_metadata
for line in self.get_metadata_lines(name):
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1369, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1361, in get_metadata
return self._get(self._fn(self.egg_info,name))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1470, in _get
stream = open(path, 'rb')
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/numpydoc-0.4-py2.7.egg/EGG-INFO/entry_points.txt'
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenv has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
This happens when source /usr/local/bin/virtualenvwrapper.sh is executed.
Any ideas? Thanks.
EDIT: Although I am getting this error message, it seems my virtualenv is kind of working. I am able to create new env and even workon them. But every command I ttype, I get the IOError above.
Fixed. I just uninstalled the offending numpy doc package:
sudo pip uninstall numpydoc
Related
I successfully installed Scrapy.
I created a virtual environment on ubuntu which is on the new windows terminal.
when i try to create a new project i get this error
Traceback (most recent call last):
File "/mnt/d/Scrapy/venv/bin/scrapy", line 8, in <module>
sys.exit(execute())
File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/cmdline.py", line 143, in execute
_run_print_help(parser, _run_command, cmd, args, opts)
File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/cmdline.py", line 98, in _run_print_help
func(*a, **kw)
File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/cmdline.py", line 151, in _run_command
cmd.run(args, opts)
File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/commands/startproject.py", line 110, in run
self._copytree(self.templates_dir, abspath(project_dir))
File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/commands/startproject.py", line 83, in _copytree
self._copytree(srcname, dstname)
File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/commands/startproject.py", line 83, in _copytree
self._copytree(srcname, dstname)
File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/commands/startproject.py", line 88, in _copytree
copystat(src, dst)
File "/usr/lib/python3.8/shutil.py", line 376, in copystat
_copyxattr(src, dst, follow_symlinks=follow)
File "/usr/lib/python3.8/shutil.py", line 326, in _copyxattr
os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)
PermissionError: [Errno 13] Permission denied: '/mnt/d/Scrapy/demo_pro/module/spiders'
Scrapy does some things with file attributes that don't work on a Windows filesystem under WSL.
As a workaround, you could create the project on the WSL filesystem and then copy the result to where you want it. Something along the lines of:
$ cd /tmp
$ scrapy startproject demo_pro
$ cp -r demo_pro /mnt/d/Scrapy
I am getting the following error message when trying mlflow examples and running 'mlflow ui'.
Error:
ModuleNotFoundError: No module named 'fcntl' Running the mlflow server
failed. Please see the logs above for details
Is anyone aware of a solution to this issue?
I have tried the solutions suggested at https://github.com/mlflow/mlflow/pull/1080
without success. Replacing the modified files in mlflow source code, it raises other issues for not finding what it is looking for with the following:
Traceback (most recent call last):
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\envs\thesis_mlflow\Scripts\mlflow.exe\__main__.py", line 9, in <module>
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\site-packages\click\core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\site-packages\mlflow\cli.py", line 198, in ui
_run_server(backend_store_uri, default_artifact_root, "127.0.0.1", port, None, 1)
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\site-packages\mlflow\server\__init__.py", line 90, in _run_server
exec_cmd(full_command, env=env_map, stream_output=True)
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\site-packages\mlflow\utils\process.py", line 34, in exec_cmd
stdin=subprocess.PIPE, **kwargs)
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\subprocess.py", line 729, in __init__
restore_signals, start_new_session)
File "c:\programdata\anaconda3\envs\thesis_mlflow\lib\subprocess.py", line 1017, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
Just solved the issue: for some reason, waitress was not installed in the running environment. After installing it, everything seems working fine with the solution #1080 linked above in the question.
Perform the following installation before executing the mlflow ui command:
pip install waitress
I am facing the following error:
Warning: the environment variable LANG is not set!
We recommend setting this in ~/.profile (or equivalent) for proper expected behavior.
Creating a virtualenv for this project…
Using /usr/local/opt/python/bin/python3.6 (3.6.4) to create virtualenv…
⠋Traceback (most recent call last):
File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.6/site-packages/pipenv/pew/__main__.py", line 8, in <module>
import pew
File "/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/__init__.py", line 1, in <module>
from . import pew
File "/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/pew.py", line 41, in <module>
from pew._utils import (check_call, invoke, expandpath, own, env_bin_dir,
File "/usr/local/lib/python3.6/site-packages/pipenv/patched/pew/_utils.py", line 22, in <module>
encoding = locale.getlocale()[1] or 'ascii'
File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py", line 581, in getlocale
return _parse_localename(localename)
File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py", line 490, in _parse_localename
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8
Virtualenv location:
Creating a Pipfile for this project…
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 11, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 366, in install
selective_upgrade=selective_upgrade,
File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 1761, in do_install
skip_requirements=skip_requirements,
File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 636, in ensure_project
ensure_pipfile(validate=validate, skip_requirements=skip_requirements)
File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 289, in ensure_pipfile
project.create_pipfile(python=python)
File "/usr/local/lib/python3.6/site-packages/pipenv/project.py", line 518, in create_pipfile
'python_version': python_version(required_python)[: len('2.7')]
TypeError: 'NoneType' object is not subscriptable
I tried setting the LANG in ~/.profile and ~/.bash_profile. Both didn't work.
What worked for me on Mac OS X Sierra is adding the following into my ~/.bash_profile file:
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
Then I reloaded the bash profile with: source ~/.bash_profile
For those who use zsh shell, you must add those lines to your ~/.zshrc
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
Then I reload the bash profile with: source ~/.zshrc
For those who use zsh you must add those lines to your ~/.zshrc
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
I'm working with miniconda and git=bash on win7. I'm trying to make a virtualenv:
$ virtualenv myenv
Traceback (most recent call last):
File "e:\miniconda2\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "e:\miniconda2\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "e:\miniconda2\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
File "e:\miniconda2\lib\site-packages\virtualenv.py", line 713, in main
symlink=options.symlink)
File "e:\miniconda2\lib\site-packages\virtualenv.py", line 925, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "e:\miniconda2\lib\site-packages\virtualenv.py", line 1202, in install_python
mkdir(bin_dir)
File "e:\miniconda2\lib\site-packages\virtualenv.py", line 323, in mkdir
os.makedirs(path)
File "e:\miniconda2\lib\os.py", line 157, in makedirs
mkdir(name, mode)
WindowsError: [Error 5] Access is denied: 'e:\\ENVS\\virtalenvs\\myenv\\Scripts'
How can I get this working?
I run the following command in terminal sudo python2.6 setup.py install and after some output I get the below error.
Traceback (most recent call last):
File "setup.py", line 16, in <module>
packages=find_packages()
File "/opt/python2.6/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/opt/python2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/opt/python2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/install.py", line 76, in run
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/install.py", line 104, in do_egg_install
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 211, in run
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 427, in easy_install
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 478, in install_item
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 519, in process_distribution
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 570, in resolve
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2149, in requires
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2141, in _dep_map
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2560, in split_sections
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1854, in yield_lines
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2163, in _get_metadata
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1181, in get_metadata_lines
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1178, in get_metadata
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1238, in _get
zipimport.ZipImportError: bad local file header in /opt/python2.6/lib/python2.6/site-packages/businesscommon-5.63-py2.6.egg
I ran the command unzip -t /opt/python2.6/lib/python2.6/site-packages/businesscommon-5.63-py2.6.egg to see if the EGG file is a valid ZIP file and it returned 'No errors detected'.
I've done some research on zipimport.ZipImportError but can't seem to figure how really to debug or fix it. I don't have much experience with Python so any help or advice would be appreciated.
Looks like all I needed to do was run sudo python2.5 setup.py install instead of sudo python2.6 setup.py install
Notice that I was oringally using python2.6 instead of python2.5.