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
Related
I am currently unable to open Idle3 editor. I am running Linux Fedora 36, when idle3 command is issued I get this:
Traceback (most recent call last):
File "/usr/bin/idle3", line 3, in <module> from idlelib.pyshell import main
File "/usr/lib64/python3.10/idlelib/pyshell.py", line 53, in <module> from idlelib import debugger
File "/usr/lib64/python3.10/idlelib/debugger.py", line 7, in <module> from idlelib import macosx
File "/usr/lib64/python3.10/idlelib/macosx.py", line 7, in <module> from test.support import requires, ResourceDenied
ModuleNotFoundError: No module named 'test'
I don't know how to solve it.
Fortunatelly the trouble with Idle3 was solved in the recent update of Fedora 36, I think the missing file was inserted.
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.
When I'm trying to install any package using PyCharm terminal, I always get this error.
(venv) C:\Users\Mi\Desktop\MAIN\Coding\python>pip install PyMySQL
Traceback (most recent call last):
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\Scripts\pip-script.py",
line 11, in <module>
load_entry_point('pip==19.0.3', 'console_scripts', 'pip')()
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 489, in load_entry_point
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 2793, in load_entry_point
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 2411, in load
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 2417, in resolve
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\cli\autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\cli\main_parser.py", line 12, in <module>
from pip._internal.commands import (
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\commands\__init__.py", line 6, in <module>
from pip._internal.commands.completion import CompletionCommand
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\commands\completion.py", line 6, in <module>
from pip._internal.cli.base_command import Command
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\cli\base_command.py", line 20, in <module>
from pip._internal.download import PipSession
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\download.py", line 6, in <module>
from json import json
ImportError: cannot import name 'json' from 'json' (C:\Users\Mi\Anaconda3\lib\json\__
init__.py)
But when I use pip install the library is installed, but it still doesn't work in PyCharm.
Thanks for help! And sorry for my english.
you can try to download corresponding pacages in '.tar.gz' format on this link
manually unzip it
enter the unzipped folder
install the package through the following cmd command:
python setup.py install
here I suppose you are using windows and your python is above 3
If you are continuously encontering this problem,I suggest you alter the original download channel to a mirror.
If you installed the library through terminal and Pycharm still doesn't recognize the library, I think may be you should select the correct interpreter for the project by clicking the project interpreter at the bottom right in a Pycharm project. Look at the image in this
link. Click on the Interpreter which is named just "Python 3.x", it may work then.
["3.x" as in which version of python you are using]
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.
PyQt4 is installed on a OSX system using homebrew and using python 2.7.5. Virtualenvwrapper is used to setup an environment for the current project.
Running a python script that imports the PyQt4 module gives the following error:
Traceback (most recent call last):
File "test.py", line 9, in <module>
from PyQt4.QtGui import *
ImportError: No module named PyQt4.QtGui
brew test pyqt popups a PyQt window and the test appears to pass.
$ brew install PyQt
Warning: pyqt-4.10.4 already installed
Question: Why does the ImportError still occurs?
Attempt 1
Copied the pyqt directory from brew's install directory to virtualenv's lib/python-2.7/site-packages directory. Still getting the same error
File "test.py", line 9, in <module>
from PyQt4.QtGui import *
ImportError: No module named PyQt4.QtGui
Attempt 2
$ virtualenv test
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: virtualenv==1.10.1
To fix this error, we do:
$ easy_install --upgrade pip
$ virtualenv --system-site-packages test
Lets install a required package:
$ pip install pyserial
And we get the same error when we run the script that imports pyqt:
$ python test.py
File "test.py", line 9, in <module>
from PyQt4.QtGui import *
ImportError: No module named PyQt4.QtGui
Furthermore, virtualenv now appears broken in this virtualenv, but works in other virtualenvs:
$ virtualenv
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: virtualenv==1.10.1