Installation Error while installing portia - python

Followed instructions on the github page. Of course, had to make minor changes since I was working with a windows 7 system. I got to the point post creating the virtual environment for portia to run. And I was trying to install the required packages using pip.
pip install -r requirements.txt
It failed with a log.
Now in the shell I try to run twistd, it gives error saying command not found. I even tried as follows:
deostroll#DEOTOP /c/Portia/portia/slyd (master)
$ python ../../portia_env/Scripts/twistd.py -n slyd
Traceback (most recent call last):
File "../../portia_env/Scripts/twistd.py", line 13, in <module>
from twisted.scripts.twistd import run
File "c:\Portia\portia_env\lib\site-packages\twisted\__init__.py", line 53, in
<module>
_checkRequirements()
File "c:\Portia\portia_env\lib\site-packages\twisted\__init__.py", line 37, in
_checkRequirements
raise ImportError(required + ": no module named zope.interface.")
ImportError: Twisted requires zope.interface 3.6.0 or later: no module named zop
e.interface.
(portia_env)
deostroll#DEOTOP /c/Portia/portia/slyd (master)
$
Is there an alternate procedure to follow in order to make this work on windows?

It looks like zope.interface didn't install when you ran:
pip install -r requirements.txt
Could you try running the following and see if it works?
pip install zope.interface

Related

Python3.7 on Windows Ubuntu Bash shell ImportError: cannot import name 'HTTPSHandler' from 'urllib.request' (/usr/lib/python3.7/urllib/request.py)

I've recently updated Python to version 3.7 from version 3.5, and made it the default in my bash shell. I've also updated pip and made sure it uses Python3.7.
Now, whenever I try to install any module using pip I get this error"
$pip3 install google
Traceback (most recent call last): File "/home/AnnaK/.local/bin/pip3", line 7, in <module>
from pip._internal.cli.main import main File "/usr/lib/python3/dist-packages/pip/__init__.py", line 16, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/usr/lib/python3/dist-packages/pip/vcs/subversion.py", line 9, in <module>
from pip.index import Link File "/usr/lib/python3/dist-packages/pip/index.py", line 30, in <module>
from pip.wheel import Wheel, wheel_ext File "/usr/lib/python3/dist-packages/pip/wheel.py", line 39, in <module>
from pip._vendor.distlib.scripts import ScriptMaker File "/usr/share/python-wheels/distlib-0.2.2-py2.py3-none-any.whl/distlib/scripts.py", line 14, in <module> File "/usr/share/python-wheels/distlib-0.2.2-py2.py3-none-any.whl/distlib/compat.py", line 66, in <module> ImportError: cannot import name 'HTTPSHandler' from 'urllib.request' (/usr/lib/python3.7/urllib/request.py)
I get the same error if I try to simply run pip. This didn't happen when I was using python3.5. I did have this problem when briefly using python2.7, but I fixed it using https://askubuntu.com/questions/581999/pip-raises-importerror-cannot-import-name-httpshandler. That solution doesn't seem to work for python3.7.
I've tried to reinstall pip, reinstall python3, update my Windows Ubuntu subsystem, and reinstall libssl-dev. I'm stumped. Any help is appreciated!
You must have inadvertently upgraded your system pip (probably through something like sudo pip install pip --upgrade)
pip x.x adjusts where its internals are situated. The pip3 command you're seeing is one provided by your package maintainer and is not a file managed by pip.
You can read more about this on pip's issue tracker
You'll probably want to not upgrade your system pip and instead use a virtualenv.
To recover the pip3 binary you'll need to sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall.
It should work fine if you use the first approach python3 -m pip ... instead of pip3 ....

ImportError: No module named pyopengv

Hi, I am having problem using openSFM. My first time....
I tried the command
bin/opensfm_run_all data/berlin
and the error comes out like this:
Running using Python command: python
Traceback (most recent call last):
File "/home/yjw/OpenSfM/bin/opensfm", line 10, in <module>
from opensfm import commands
File "/home/yjw/OpenSfM/opensfm/commands/__init__.py", line 4, in <module>
from . import match_features
File "/home/yjw/OpenSfM/opensfm/commands/match_features.py", line 9, in <module>
from opensfm import matching
File "/home/yjw/OpenSfM/opensfm/matching.py", line 3, in <module>
import pyopengv
ImportError: No module named pyopengv
It seems like pyopengv is not installed so I tried the
pip install opengv and pip3 install opengv
but then another problem comes out...
Collecting opengv
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/opengv/
Can anyone give me solution, please? Thanks is advance!!
The problem is that there is no opengv library in PyPi repository, you have to install it manually as explained here: http://laurentkneip.github.io/opengv/page_installation.html
sudo apt-get install build-essential cmake libeigen3-dev
git clone https://github.com/laurentkneip/opengv
cd opengv
mkdir build && cd build && cmake .. && make
It is an environment error. it is likely that opengv for python V3 has been installed into the python V2 folder. Please try using opengv's cmake option
cmake ../opengv -DBUILD_PYTHON=ON -DPYBIND11_PYTHON_VERSION=3.6 -DPYTHON_INSTALL_DIR=/usr/local/lib/python3.6/dist-packages/

python telegram bot - bot run error

When I try to run a bot, I get this error message in the terminal:
zass#zass-system-product-name:~/python-telegram-bot/examples$python
echobot.py
/usr/local/lib/python2.7/dist-packages/python_telegram_bot-8.0-
py2.7.egg/telegram/utils/request.py:38: UserWarning: python-telegram-
bot wasn't properly installed. Please refer to README.rst on how to
properly install.
Traceback (most recent call last):
File "echobot.py", line 8, in <module>
import telegram
File "build/bdist.linux-x86_64/egg/telegram/__init__.py", line 94, in
<module>
File "build/bdist.linux-x86_64/egg/telegram/bot.py", line 34, in
<module>
File "build/bdist.linux-x86_64/egg/telegram/utils/request.py", line
33, in <module>
ImportError: No module named ptb_urllib3.urllib3
I'm running Python 2.7 on ubuntu, git and telegram bot are installed. - How can I fix it?
First of all make sure you have urllib3 installed. Sometimes urllib3 installation breaks. If for some reason your install of urllib3 is failing to include the util submodule, you could simply download the archive from the pypi page and copy the util folder from there to your urllib3 install location.
You may also issue the command below to get an up-to-date version:
sudo pip install urllib3 --upgrade
Then, see where your module is by starting a python interpreter and check where the urllib3 module is being loaded from:
python -c "import urllib3; print urllib3.__file__"
If all the above didn't work for you, make sure you're importing it right! and make sure there is no conflict.
If you clone the python-telegram-bot repo you need to run the following command before installing the code:
git submodule update --init --recursive
Then install the code with python setup.py install
Maybe you have 2 version of python and default version is 3.x
Try to check version of python
python -V
if default version is 3 then run your code with python version 2.
python2 echobot.py
it can be python2 or python2.7
Also it can be cause of versions of libs

Virtualenv package upgrade and install fails: cannot import name Message

I try to upgrade pip within a virtualenv following the instructions here. The upgrade fails because the system python cannot import the name Message from the email module.
(newsfeed)myhost:newsfeed admin$ pip install --upgrade pip
Traceback (most recent call last):
File "/Users/admin/newsfeed/newsfeed/bin/pip", line 7, in <module>
from pip import main
File "/Library/Python/2.7/site-packages/pip/__init__.py", line 9, in <module>
from pip.log import logger
File "/Library/Python/2.7/site-packages/pip/log.py", line 8, in <module>
from pip import backwardcompat
File "/Library/Python/2.7/site-packages/pip/backwardcompat/__init__.py", line 69, in <module>
from email import Message as emailmessage
ImportError: cannot import name Message
This problem is not just with upgrading pip but with installing anything within the virtualenv. When new package installations are attempted the same error occurs.
In a python terminal outside the virtualenv Message cannot be imported, but inside the virtualenv it can.
Also, in a different virtualenv on the same machine, there is no error installing or upgrading packages.
Why can't this virtualenv upgrade or install packages?
The standard library's email package is being shadowed (hidden) by a package or module named email(.py) in your path.
Locate the package by calling
python -c 'import email;print(email.__file__)'
and rename it or remove it.
Your pip is not inside the venv so you will probably not be able to upgrade it like this.
This is caused by the fact that you created a venv that uses system-packages. Remove the venv and recreate it by adding --no-site-packages as a parameter.

Redhat trying to use pip ImportError: No module named pip

I am trying to use pip on my Redhat system.
I installed pip following the instructions here, but when I try to use it, for example pip install, I get the following error code:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in ?
from pip import main
ImportError: No module named pip
this issue due to common user do not have privilege to access packages py file.
1. root user can run 'pip list'
2. other common user cannot run 'pip list'
[~]$ pip list
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip._internal import main
ImportError: No module named pip._internal
solution :
root user login and run
chmod -R 755 /usr/lib/python2.7
fix this issue.
If pip is already installed and your unable to access it, one of the reason could be that you don't have permissions to read or execute the library. Try doing
sudo chmod -R u+rx /usr/lib/python2.7/site-packages/pip/
If pip is installed in a different folder, you can obtain the folder path by doing
>>> import pip
>>> pip.__path__
['/usr/lib/python2.7/site-packages/pip']
If you don't have root rights and running on python 2.6 then you can try this file https://bootstrap.pypa.io/2.6/get-pip.py (it is from same instruction you used, it is a simple python script which installs all dependencies and pip itself) and run it with command python get-pip.py --user

Categories

Resources