Tensorflow API Ubuntu 14.04 python 2.7 Error - python-2.7

from utils import label_map_util
ImportError: No module named utils
I tried to fix this problem but I can't, this similar my case
Case 1 and Case 2
please help me if Ubuntu 14.04 with python 2.7 fix it
thanks in advance!!

First, clone this:https://github.com/tensorflow/models and include the path to your code the folder is in the research folder research/object_detection:
import sys
sys.path
sys.path.insert(0, 'path/to/your/object_detection')
Or this way
import( os )
os.chdir( 'path/to/your/object_detection' )
and change your import to be:
from object_detection.utils import label_map_util

Related

ModuleNotFoundError: No module named 'textencoder' error when upgraded to python 3

Currently I have migrated my python2 django project to python 3 & after conversion to py3 I am getting below kind of error for below code.
from hubarcode.code128 import Code128Encoder
encoder = Code128Encoder(pur_num, {'is_reliable': False})
Trackeback is as below.
from hubarcode.code128 import Code128Encoder
File "D:\my_project\venv\lib\site-packages\hubarcode\code128__init__.py", line 16, in
from textencoder import TextEncoder
ModuleNotFoundError: No module named 'textencoder'
I have tried to search for solution online on google but not able to solve it.
Any suggestions ?
Thanks.
I am able to solve issue by using pyStrich.
First you need to install pyStrich using pip3 install pyStrich and after thatn
What you need to do is just replace from hubarcode.code128 import Code128Encoder with
from pystrich.code128 import Code128Encoder.
I hope it may help others who have been facing same kind of problem.
pip freeze will show it if you have this module installed in your venv
pip install textencoder to resolve problem

Caffe Framework :Importing Error

I followed the instructions from "https://gist.github.com/nikitametha/c54e1abecff7ab53896270509da80215" and installed caffe framework.
But ,when I import caffe from some other directory ,it is showing this error
caffe framework was installed but, it still shows the import error -
No module named caffe
How to solve this issue?
Thank you...
You need to add ~/caffe/python to your $PYTHONPATH. either
~$ PYTHONPATH=$PYTHONPATH:~/caffe/python python
>>> import caffe
Or you can do it inside python
>>> import sys
>>> sys.path.insert(0, '~/caffe/python')
>>> import caffe
Alternatively, you can modify your ~/.bashrc file and fix PYTHONPATH environmet variable there

ImportError: No module named vaderSentiment

I'm trying to run a code in python2.7 on windows os that uses sentiment analysis
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analyzer = SentimentIntensityAnalyzer()
and I'm getting this error
ImportError: No module named vaderSentiment
Can anyone help me with this?
Assuming you solved this one as it's from 7 months ago, but for anyone else searching for it:
Go into terminal/cmd and paste the following:
pip install vaderSentiment
More info on VADER: https://github.com/cjhutto/vaderSentiment
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
#note: depending on how you installed (e.g., using source code download versus pip install), you may need to import like this:
#from vaderSentiment import SentimentIntensityAnalyzer
read the comment in a code
Try running your file with Python3 instead of just python. Sometimes when you have different pips/pythons installed on your computer you might have vaderSentiment installed in python2 when you need to run it in python3.

cannot import name module with module correctly installed

new in python.
I have python 2.7.
I just installed a new module (beatifulsoup) from cmd in windows 7 which is correctly installed : When I enter the python consol from the cmd I can import succesfully bs4 without error.
My problem is that I cannot import it when I am using Aptana studio. Or if I code it in sublimetext and save it as a py file, when I run it I get the error message "cannot import name beautifulsoup 4". I don't get why? Is it a problem of pydev environment on aptana? If yes how can I add modules to Aptana and sublimetext3 ?
Are you trying to import like this:
from bs4 import BeautifulSoup
If not, try it that way. Hope this helps!
(Perhaps you should add your import statement to the question so we can see if there is a problem with the statement or if the issue resides somewhere else)

import error in django-sendsms

I'm trying to use django-sendsms based on this documentation
I downloaded the package,copied it's folder in c: and ran this command in shell
c:
cd django-sendsms
python setup.py install
these commands installed django-sms in sitepackages folder.then based on the documentation I added this backend to settings.py:
SENDSMS_BACKEND = 'sendsms.backends.console.SmsBackend'
and in views.py :
from sendsms import api
api.send_sms(body='I can haz txt', from_phone='+41791111111', to=['+41791234567'])
but I get this error:
No module named importlib
every thing is based on the documentation,I don't know what's wrong with it!
Which version of Python are you using? It seems that module (in sendsms/util.py) will import the library called importlib which only exists in Python 2.7. If you are using Python 2.6 or lower, that library do not exist.