Can't find submodule in package - python

I'm using Anaconda3 version 4.2.0 on ubuntu (in docker).
Anaconda is installed in /root/anaconda3 folder.
I installed theano_bpr package using pip install theano_bpr.
Now when i open python and try import theano_bpr, i get the following message:
>>> import theano_bpr
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/anaconda3/lib/python3.5/site-packages/theano_bpr/__init__.py", line 17, in <module>
from bpr import BPR
ImportError: No module named 'bpr'
However, when i navigate to /root/anaconda3/lib/python3.5/site-packages/theano_bpr/ and run python there, i'm able to import theano_bpr.
In /root/anaconda3/lib/python3.5/site-packages/theano_bpr/ there are following files:
__init__.py, bpr.py (this one is causing problems), t.py, and utils.py.

Related

Can't import pymatgen.core "No module named 'pymatgen.core'"

I've used pip install pymatgen with Python 3.9.1 on Windows 10 to install pymatgen, but I'm getting the following error:
Traceback (most recent call last):
File "D:\code\pymatgen\pymatgen.py", line 1, in <module>
import pymatgen.core as mg
File "D:\code\pymatgen\pymatgen.py", line 1, in <module>
import pymatgen.core as mg
ModuleNotFoundError: No module named 'pymatgen.core'; 'pymatgen' is not a package
I have also tried to install the previous 2 versions but still getting the same error though I can already see it in the pip list
pymatgen 2022.3.22
What am I missing?
Maybe try using conda ? if this doesn't work then there is definitely some dependencies issue
https://pymatgen.org/installation.html

tensorflow - Import Error : cannot import name rnn_cell_impl

Using anaconda, I had installed python 2.7 and tensorflow 1.0.0 to run the package called DeepNovo.
Then I got following error when I tried to run this python script:
Traceback (most recent call last):
File "deepnovo_main.py", line 15, in module import deepnovo_model
File "/Data2/HJE/DeepNovo/deepnovo_model.py", line 43, in <module>
from tensorflow.python.ops import rnn_cell_impl
ImportError: cannot import name rnn_cell_impl
Anyone any ideas?
You want to include a package. That package already required other package. package name is rnn_cell_impl. Make sure path is correct. You can read python modules packages

ImportError: No module named gobject

I installed ros1 and created a catkin workspace. Inside the src folder I cloned a ros package "executive_smach_visualization". But when I try to run it with the following command I am getting an error.
rosrun smach_viewer smach_viewer.py
Traceback:
wxversion 2.8 is not installed, installed versions are ['3.0-gtk3']
Traceback (most recent call last):
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/scripts/smach_viewer.py", line 77, in <module>
from smach_viewer import xdot
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/src/smach_viewer/xdot/__init__.py", line 1, in <module>
import wxxdot
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/src/smach_viewer/xdot/wxxdot.py", line 22, in <module>
from xdot import *
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/src/smach_viewer/xdot/xdot.py", line 34, in <module>
import gobject
ImportError: No module named gobject
I have already tried following:
1) Installed goobject using pip
2) cloned gobject from git to src folder of catkin_ws, catkin_make and setup.bash
What could be the problem? Please let me know if I am missing any important input. Thanks in advance.
This issue occurs if there is different version of ros, python and so on.
It seems package is a little bit outdated.
Edit:
After downloading package and when building your working environment, use:
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so
Please refer to 1.5 section (User configuration) of this guide

getting this error while loading a tensorflow project

getting a error while a installing a tensorflow python project from https://github.com/victordibia/skyfall
first i tried to install the requiremnt.txt file i got Could not detect requirement name for 'git+https://github.com/dpallot/simple-websocket-server.git', please specify one with #egg=your_package_name error,
then i removed the last line of txt file, then getting this
Traceback (most recent call last):
File "app.py", line 18, in
from utils import web_socket_server
File "C:\Users\anurag\Downloads\skyfall-master\utils\web_socket_server.py", line 4, in
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
ModuleNotFoundError: No module named 'SimpleWebSocketServer'
after that i installed git , now getting this
Traceback (most recent call last):
File "app.py", line 19, in
from utils import web_socket_client
File "C:\Users\anurag\Downloads\skyfall-master\utils\web_socket_client.py", line 8, in
from websocket import WebSocketException, WebSocketConnectionClosedException
ImportError: cannot import name 'WebSocketException'
The error means that you have not installed this package: https://github.com/dpallot/simple-websocket-server
Try this to install it(you must have pip installed and also git) and then run the project again:
python -m pip install git+https://github.com/dpallot/simple-websocket-server.git

Can't import the py-translate 1.03 package

Is someone familiar with these package?
I tried easy install and many things I saw in imports problems solution
>>> import translate
output:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import translate
File "C:\Python27\lib\site-packages\translate\__init__.py", line 8, in <module>
from .translator import *
File "C:\Python27\lib\site-packages\translate\translator.py", line 13, in <module>
import requests
ImportError: No module named requests
Moreover, in the directory of the package there is a test file.
I tried to run it but I got this:
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\translate\tests\test_translator.py", line 10, in <module>
from ..translator import translator
ValueError: Attempted relative import in non-package
How have you installed py-translate.
It requires: requests
My advice is pip install requests (or easy_install requests)
Their latest release is 1.0.2, but also goes by 1.0.3.
Pip install the package, don't just download the archive as you will miss the dependancies

Categories

Resources