Two different site-packages in Anaconda environment? - python

I have a fresh install of Anaconda and have created an environment as follows:
conda create --name etl
I activate etl and then conda install ipython from within it. It installs everything, but when I go to run ipython I get the following error:
Traceback (most recent call last):
File "C:\Program Files\Anaconda3\envs\etl\Scripts\ipython-script.py", line 3, in <module>
import IPython
File "C:\Program Files\Anaconda3\envs\etl\lib\site-packages\IPython\__init__.py", line 54, in <module>
from .core.application import Application
File "C:\Program Files\Anaconda3\envs\etl\lib\site-packages\IPython\core\application.py", line 23, in <module>
from traitlets.config.application import Application, catch_config_error
File "C:\Program Files\Anaconda3\envs\etl\lib\site-packages\traitlets\config\__init__.py", line 6, in <module>
from .application import *
File "C:\Program Files\Anaconda3\envs\etl\lib\site-packages\traitlets\config\application.py", line 17, in <module>
from decorator import decorator
ImportError: No module named 'decorator'
In looking into it, it seems that anaconda has created 2 site-packages within the environment:
Note that this site-package is at the root of the environment.
This site package is not in the root, but rather is a sub-directory of Lib which is where I would expect it. I'm wondering if I did something wrong or if this is possibly a bug? If I manually move the files in the first site-directory to the second, the error goes away.

Related

I have broken my poetry installation, and I don't know where to begin to fix it

I was using poetry in combination with pyenv for some hobby projects. I created some virtualenvs with pyenv inside some poetry hobby projects. For some reason, I deleted some of these python installs that broke the virtualenvs within these projects and now poetry won't work anymore. I'm getting this message when I try to start poetry. I'm using Linux Mint 20.1:
/home/milkman/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
"program uses threads.", RuntimeWarning)
Traceback (most recent call last):
File "/home/milkman/.poetry/bin/poetry", line 16, in <module>
from poetry.console import main
File "/home/milkman/.poetry/lib/poetry/console/__init__.py", line 1, in <module>
from .application import Application
File "/home/milkman/.poetry/lib/poetry/console/application.py", line 7, in <module>
from .commands.about import AboutCommand
File "/home/milkman/.poetry/lib/poetry/console/commands/__init__.py", line 4, in <module>
from .check import CheckCommand
File "/home/milkman/.poetry/lib/poetry/console/commands/check.py", line 2, in <module>
from poetry.factory import Factory
File "/home/milkman/.poetry/lib/poetry/factory.py", line 18, in <module>
from .repositories.pypi_repository import PyPiRepository
File "/home/milkman/.poetry/lib/poetry/repositories/pypi_repository.py", line 33, in <module>
from ..inspection.info import PackageInfo
File "/home/milkman/.poetry/lib/poetry/inspection/info.py", line 25, in <module>
from poetry.utils.env import EnvCommandError
File "/home/milkman/.poetry/lib/poetry/utils/env.py", line 23, in <module>
import virtualenv
File "/home/milkman/.poetry/lib/poetry/_vendor/py2.7/virtualenv/__init__.py", line 3, in <module>
from .run import cli_run, session_via_cli
File "/home/milkman/.poetry/lib/poetry/_vendor/py2.7/virtualenv/run/__init__.py", line 13, in <module>
from .plugin.activators import ActivationSelector
File "/home/milkman/.poetry/lib/poetry/_vendor/py2.7/virtualenv/run/plugin/activators.py", line 6, in <module>
from .base import ComponentBuilder
File "/home/milkman/.poetry/lib/poetry/_vendor/py2.7/virtualenv/run/plugin/base.py", line 5, in <module>
from backports.entry_points_selectable import entry_points
ImportError: No module named entry_points_selectable
I have no idea where to start to fix this. Anytime I try a command with poetry I get this same message. Can anyone point me in the right direction?
Thank you!
May be you have deleted some library files. You can try removing poetry and all libraries that your app is using. Start fresh installation of poetry.
You can use pip to install and uninstall.
Other wise start a new project from fresh.
It appears you accidentally deleted some of the library's functions. Try just removing it and reinstalling.

unable to open jupyter notebook using command prompt, tried installing again and again differently

I ran jupyter notebook and I'm getting the following error. Please help!
I checked the conda version, it's working fine. I added paths in the environment variables. I don't know why it isn't working. Previously it worked fine I recently uninstalled it and installed it again.
Traceback (most recent call last):
File "C:\Users\Admin\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\Admin\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 51, in <module>
from zmq.eventloop import ioloop
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\__init__.py", line 50, in <module>
from zmq import backend
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed while importing error: The specified module could not be found.
getting this error,
please help!
There can be an issue with the 64bit version of Anaconda, Try these steps:
Install Anaconda 32 Bit for windows.
Add \Anaconda3 and \Anaconda3\Script to Path in Environment variables.
Open Anaconda Prompt and Create an Environment and activate it.
Once you activate the Environment, you will into it. Then write the command JUPYTER
NOTEBOOK, it should run on your Browser.
If that dose not work you can go back and install a bit older version of Anaconda and try doing the same.
Here for more help (:

running pyinstaller after Anaconda install results in ImportError: no Module named 'pefile'

I did conda install -c acellera pyinstaller=3.2.3 as per Anaconda's website and it looks like it installed correctly but I get the following if I try to run it via cmd:
C:\Users\Cornelis Dirk Haupt\PycharmProjects\Mesoscale-Brain-Explorer\src>pyinstaller
Traceback (most recent call last):
File "C:\Anaconda3\Scripts\pyinstaller-script.py", line 9, in <module>
load_entry_point('PyInstaller==3.3.dev0+g8756735', 'console_scripts', 'pyinstaller')()
File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 542, in load_entry_point
File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2569, in load_entry_point
File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2229, in load
File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2235, in resolve
File "C:\Anaconda3\lib\site-packages\PyInstaller\__main__.py", line 21, in <module>
import PyInstaller.building.build_main
File "C:\Anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 34, in <module>
from .api import PYZ, EXE, COLLECT, MERGE
File "C:\Anaconda3\lib\site-packages\PyInstaller\building\api.py", line 38, in <module>
from PyInstaller.utils.win32 import winmanifest, icon, versioninfo, winresource
File "C:\Anaconda3\lib\site-packages\PyInstaller\utils\win32\versioninfo.py", line 17, in <module>
import pefile
ImportError: No module named 'pefile'
What's going on? Pyinstaller works fine with python 2.7 without Anaconda. But I've recently decided to make the jump to Anaconda + 3.5. I cant find any module named pefile or how to install it with Anaconda. I can install pefile easily using pip3 though.
You can use Anaconda's pip to install it, just go to the Script folder in Anaconda and execute:
pip.exe install pefile
install this instead:
conda install -c conda-forge pyinstaller=3.2.1
working fine for me after a couple of tries!

Spyder doesn't load from Anaconda 3.4

I've recently just installed Anaconda 3 (for Python 3.4) on a fresh Ubuntu 14.04 installation.
When I go to launch the spyder IDE, I receive following error message:
No module named 'version'
Traceback (most recent call last):
File "/home/daniel/anaconda3/bin/spyder", line 3, in <module>
start_app.main()
File "/home/daniel/anaconda3/lib/python3.4/site-packages/spyderlib/start_app.py", line 91, in main
from spyderlib import spyder
File "/home/daniel/anaconda3/lib/python3.4/site-packages/spyderlib/spyder.py", line 158, in <module>
from spyderlib.utils.environ import WinUserEnvDialog
File "/home/daniel/anaconda3/lib/python3.4/site-packages/spyderlib/utils/environ.py", line 17, in <module>
from spyderlib.widgets.dicteditor import DictEditor
File "/home/daniel/anaconda3/lib/python3.4/site-packages/spyderlib/widgets/dicteditor.py", line 28, in <module>
from spyderlib.utils.qthelpers import mimedata2url
File "/home/daniel/anaconda3/lib/python3.4/site-packages/spyderlib/utils/qthelpers.py", line 24, in <module>
from spyderlib.guiconfig import get_shortcut
File "/home/daniel/anaconda3/lib/python3.4/site-packages/spyderlib/guiconfig.py", line 24, in <module>
from spyderlib.widgets.sourcecode import syntaxhighlighters as sh
File "/home/daniel/anaconda3/lib/python3.4/site-packages/spyderlib/widgets/sourcecode/syntaxhighlighters.py", line 32, in <module>
required_version=PYGMENTS_REQVER)
File "/home/daniel/anaconda3/lib/python3.4/site-packages/spyderlib/dependencies.py", line 70, in add
installed_version)]
File "/home/daniel/anaconda3/lib/python3.4/site-packages/spyderlib/dependencies.py", line 32, in __init__
self.installed_version = programs.get_module_version(modname)
File "/home/daniel/anaconda3/lib/python3.4/site-packages/spyderlib/utils/programs.py", line 218, in get_module_version
mod = __import__(module_name)
File "/home/daniel/qiime_software/sphinx-1.0.4-release/lib/python2.7/site-packages/Pygments-1.6-py2.7.egg/pygments/init.py", line 46
except TypeError, err:
^
SyntaxError: invalid syntax
I installed Conda 3.7 by downloading the .sh file through http://continuum.io/downloads#py34 and then installing it through the terminal with "bash Anaconda3-2.1.0-Linux-x86_64.sh"
What could be the issue?
I may have spotted the issue but still need some help:
When I first made this Ubuntu installation, I put QIIME on here (which is a suite of programs that have been made to work in their own environment for bioinformatics).
I see that in the list of file calls, everything is coming from .../anaconda3/... until the very last line, something is mistakenly (?) called from .../qiime_software/...
I'm assuming this is from both software suites containing python in their PATHs... how may this be fixed? Granted when I check "which python" in the terminal, it (correctly) outputs:
/home/daniel/anaconda3/bin/python
I almost thought a prior question asked here: Anaconda Spyder Qt library error on launch would lead me on the right path but I hit a deadend.
Update:
echo $PYTHONPATH spits out:
/home/daniel/qiime_software/qiime-galaxy-0.0.1-repository-c2814c3c/lib/:/home/daniel/qiime_software/qiime-1.8.0-release/lib/python2.7/site-packages:/home/daniel/qiime_software/qiime-1.8.0-release/lib/:/home/daniel/qiime_software/matplotlib-1.3.1-release/lib/python2.7/site-packages:/home/daniel/qiime_software/pprospector-1.0.1-release/lib/python2.7/site-packages:/home/daniel/qiime_software/tax2tree-1.0-release/lib/python2.7/site-packages:/home/daniel/qiime_software/pynast-1.2.2-release/lib/python2.7/site-packages:/home/daniel/qiime_software/emperor-0.9.3-release/lib/python2.7/site-packages:/home/daniel/qiime_software/pycogent-1.5.3-release/lib/python2.7/site-packages:/home/daniel/qiime_software/biom-format-1.3.1-release/lib/python2.7/site-packages:/home/daniel/qiime_software/ipython-latest-repository-184467d4/lib/python2.7/site-packages:/home/daniel/qiime_software/sphinx-1.0.4-release/lib/python2.7/site-packages:/home/daniel/qiime_software/pyqi-0.3.1-release/lib/python2.7/site-packages:/home/daniel/qiime_software/MySQL-python-1.2.3-release/lib/python2.7/site-packages:/home/daniel/qiime_software/mpi4py-1.2.2-release/lib/python2.7/site-packages:/home/daniel/qiime_software/setuptools-0.6c11-release/lib/python2.7/site-packages:/home/daniel/qiime_software/gdata-2.0.17-release/lib/python2.7/site-packages:/home/daniel/qiime_software/pysqlite-2.6.3-release/lib/python2.7/site-packages:/home/daniel/qiime_software/qcli-0.1.0-release/lib/python2.7/site-packages:/home/daniel/qiime_software/tornado-3.1.1-release/lib/python2.7/site-packages:/home/daniel/qiime_software/SQLAlchemy-0.7.1-release/lib/python2.7/site-packages:/home/daniel/qiime_software/pyzmq-2.1.11-release/lib/python2.7/site-packages:/home/daniel/qiime_software/numpy-1.7.1-release/lib/python2.7/site-packages:
Any help is appreciated.
Python looks up modules in the environment variable PYTHONPATH, so try echo $PYTHONPATH on the shell. Normally, this should be empty.
Otherwise you can try to run spyder from a dedicated environment, so try something like:
$ conda create -n spydertest spyder
$ source activate spydertest
$ spyder

openerp 7 in eclipse with pydev run error

I was trying to run openerp in order to develop new modules later. I installed indigo and the pydev plugin 2.7.3 then downloaded from launchpad the server/7.0 web and plugin of openerp , have them in a folder then added them to eclipse as pydev project . now when i try to python run the open-server I have the error message`:
Traceback (most recent call last):
File "/home/az/openerp_backup/openobject-server-7.0/openerp-server", line 6, in <module>
openerp.cli.main()
File "/home/az/openerp_backup/openobject-server-7.0/openerp/cli/__init__.py", line 51, in main
__import__(m)
File "/home/az/openerp_backup/openobject-server-7.0/openerp/modules/module.py", line 133, in load_module
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
File "/home/az/openerp_backup/openobject-server-7.0/openerp/addons/web/__init__.py", line 3, in <module>
import cli
File "/home/az/openerp_backup/openobject-server-7.0/openerp/addons/web/cli/__init__.py", line 1, in <module>
import test_js
File "/home/az/openerp_backup/openobject-server-7.0/openerp/addons/web/cli/test_js.py", line 5, in <module>
import unittest2
ImportError: No module named unittest2
The easiest solution is to install an appropriate python-unittest2 package with
sudo apt-get install python-unittest2

Categories

Resources