(Python module serial) No module named utilities.compatibility - python-2.7

I'm trying to build the PiPhone ^1, but when I execute python piphone.py, I receive the following:
I cannot seem to find anyone else who has experienced this problem. What are ways you all suggest I resolve this?
https://github.com/climberhunt/PiPhone
I've used pip uninstall serial but I haven't gotten very far solution-wise.
Traceback (most recent call last):
File "ttest.py", line 2, in <module>
import serial
File "/home/pi/.local/lib/python2.7/site-
packages/serial/__init__.py", line 10, in <module>
from . import utilities, abc, model, marshal, errors,
properties, meta, hooks, test, request
File "/home/pi/.local/lib/python2.7/site-
packages/serial/model.py", line 11, in <module>
from .utilities.compatibility import backport,
BACKWARDS_COMPATIBILITY_IMPORTS
ImportError: No module named utilities.compatibility

You installed the wrong package. You have installed serial, which is a Python package to handle object serialisation and deserialisation from and to YAML, JSON and XML and appears to be broken at the moment (I don't think the author is all that experienced in Python package development yet). Someone else already filed an issue with the package to have it renamed.
You want to install pyserial instead, which is a library to handle serial port connections.

Related

Getting no module named _internals error while using Bloomberg API

I am currently using Python 2.7 and my OS is Windows 7. While attempting to use the Bloomberg API I am getting this error:
Traceback (most recent call last):
File "datagrab.py", line 1, in <module>
import blpapi, time, json
File "C:\Python27\lib\blpapi\__init__.py", line 5, in <module>
from .internals import CorrelationId
File "C:\Python27\lib\blpapi\internals.py", line 50, in <module>
_internals = swig_import_helper()
File "C:\Python27\lib\blpapi\internals.py", line 42, in swig_import_helper
import _internals
ImportError: No module named _internals
I have set my path variable to point to blpapi3_64.dll and also updated my bloomberg terminal. I have also moved the local blpapi API to a different directory but still the problem exists.
I am kind of new to this API in general. So can someone please guide me?
Thank you in advance!
From your question is sounds like maybe you have tried this, but just outlining one possible solution from the README in the Python Supported Release release available here.
Note that many Python installations add the current directory to the
module search path. If the Python interpreter is invoked from the
installer directory, such a configuration will attempt to use the
(incomplete) local blpapi directory as a module. If the above
import line fails with the message Import Error: No module named
_internals, move to a different directory before invoking python.
I know this question is a bit stale, but in case people end up here like me. Do you have the C++ version of blpapi? it is a requirement for the python api as mentioned here: https://www.bloomberg.com/professional/support/api-library/
so download the C++ zip installer, extract somewhere, and then add it as an environment variable so that the python api can find it:
Environment variable name: BLPAPI_ROOT
Value: C:\blp\blpapi_cpp_3.8.18.1 (THIS IS WHERE MINE IS INSTALLED, YOUR VALUE HERE MAY BE DIFFERENT)
Hope that helps!

PyDSTool with anaconda not installing properly

I am trying to install PyDSTool with anaconda2 (conda install PyDSTool), which seems to go well. But when I open spyder and import PyDSTool, it gives me error
import PyDSTool
Traceback (most recent call last):
File "<ipython-input-1-a214100b00aa>", line 1, in <module>
import PyDSTool
File "/home/user/anaconda2/lib/python2.7/site-packages/PyDSTool/__init__.py", line 76, in <module>
raise RuntimeError("SciPy v0.5.1 or above is required")
RuntimeError: SciPy v0.5.1 or above is required
I tried to change parseUtils.py as per this suggestion: import of package PyDSTool doesn't work
but still the same error. I certainly have SciPy 1.0 and python 2.7.
I ran into this problem recently. The accepted answer here (PyDSTool do not recognize SciPy version) is still effective today at solving this problem.
Basically download PyDSTool from here (https://github.com/tkf/pydstool/tree/tkf) instead of sourceforge.

pip installer seems not to write in the PATH in a Python server

I tried to download Graphlab from Turi wit the following tutorial. I coded with their tools and tried to compute a Python script but it answered me an ImportError.
(gl-env)ubuntu#ip-172-hey-hey-hey:~/Eclipse-Stats$ source deactivate
discarding /home/ubuntu/anaconda2/envs/gl-env/bin from PATH
ubuntu#ip-172-hey-hey-hey:~/Eclipse-Stats$ unset PYTHONPATH
ubuntu#ip-172-hey-hey-hey:~/Eclipse-Stats$ python Main.py
2017-07-27 14:56:00.520425
/home/ubuntu/.local/lib/python2.7/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
Traceback (most recent call last):
File "Main.py", line 3, in <module>
import prediction
File "/home/ubuntu/Eclipse-Stats/prediction.py", line 1, in <module>
from graphlab.toolkits.recommender import ranking_factorization_recommender
ImportError: No module named graphlab.toolkits.recommender
Actually it cames often on the server when I tried to download with pip numpy, scipy, sklearn... Like we can see in the following conversation (in Spanish) between FJSevilla and the man of my team I'm working with.
Two things: (1) check the version of your Python console and see if it matches or is higher than the compatibility with the packages. If you look at the depreciation message and read it through, you would understand what is going on a little more. (2) be careful of what you are importing and how you import them because your formatting might also be a syntactic all error. One thing you could do is find the package, manually download, unzip, then run the setup.py.

ImportError when trying to execute command "from senti_classifier import senti_classifier"

I'm pretty sure that I've correctly installed the sentiment_classifier package on python. I have to use the package on one of my codes. The problem is that the import command is throwing an error. This is what shows up in my command prompt.
from senti_classifier import senti_classifier
Traceback (most recent call last):
File "", line 1, in
File "build\bdist.win32\egg\senti_classifier\senti_classifier.py", line 229, in
ImportError: No module named collections
However when i execute the command "import collections" no error is thrown. I've only recently started learning python and I'm relatively new to it. Any help is appreciated. Thanks!
PS the solution from Sentiment Analysis using senti_classifier and NLTK is not working for me.

How can I import the csvsql to Python 2.7

I have successfuly installed csvkit using conda install ...
However, when I try to import the libraries in Python 2.7 Spyder, I get error messages:
import csvsql
Traceback (most recent call last):
File "<ipython-input-5-303a60a6b1ac>", line 1, in <module>
import csvsql
ImportError: No module named csvsql
import csvkit
Traceback (most recent call last):
File "<ipython-input-7-ca8a99ae9834>", line 1, in <module>
import csvkit
ImportError: No module named csvkit
I looked at the documentation -- they describe the installation process but not how the library is loaded in Python.
Moreover, I had an analogous problem with httplib2. I installed it successfuly but when I tried to import it in Spyder I received an analogous error message (No module named httplib2).
(I use Anaconda 3 and Spyder on Windows 11)
Any ideas? Thank you in advance.
I asked this question on the csvkit GitHub / issues forum.
The answer given was: You should use agate on which csvkit now relies for all its operations. See https://github.com/wireservice/agate.
I'm with you -- it would be wonderful to use csvkit as a command-line tool and a library, but it's authors don't see it that way. The full issue: https://github.com/wireservice/csvkit/issues/670