Importerror with Python Buffer Library - python

I downloaded this library: https://github.com/bufferapp/buffer-python
Ran the setup.py install, and then tried to run some code using the newly installed library.
What happens though is I get this error:
Traceback (most recent call last):
File "twitter-quote-bot.py", line 14, in <module>
from buffpy.managers.profiles import Profiles
ImportError: No module named managers.profiles
The only way I've found to fix it is to move my program (twitter-quote-bot) into the downloaded folder from Buffer and run it there.
Did I do something wrong in the installation? It seems like I should be able to do these imports globally.
Thanks in advance!

Related

ImportError: no module named 'smbus2'

I'm using Pymakr on VScode to program a Pycom L01, which is connected to several sensors.
i'm trying to use smbus2 library, but i can't import it.
I created a python virtual enviroment and installed it using 'pip install smbus2', but when i try to upload the sketch, the output is:
Traceback (most recent call last):
File "main.py", line 4, in <module>
File "/flash/lib/bmp280.py", line 3, in <module>
ImportError: no module named 'smbus2'
Pycom MicroPython 1.18.2.r1 [v1.8.6-849-e0fb68e] on 2018-12-08; LoPy with ESP32
Type "help()" for more information.
Someone who can help me?
May be You have not installed smbus2 module. Please install it and import it in your program.
Solved, that was a noob mistake.
The project files were outside the virtual enviroment directory.
oof.

How to solve the output problem with CodeRunner in vscode?

I have my own project with virtual environment. When I am trying to debug code everything executes flawlessly and I get the expected output, but when I am trying to run it with run code option from Code Runner extension I receive the error:
[Running] python -u "c:\Users\slikm\Pulpit\ytapi\yt_api.py" Traceback (most recent call last): File "c:\Users\slikm\Pulpit\ytapi\yt_api.py", line 2, in <module> from googleapiclient.discovery import build ModuleNotFoundError: No module named 'googleapiclient'
I have the library which the module is taken from installed on my venv. I read that the problem might be with the interpreter the extension uses, but I don't really know how to figure it out.

Importing wxPython pops errors

Currently I am using Python 3.7, and Ubuntu 18.04. I downloaded wxPython from pip, but when I tried to import wx in my terminal, I get this error:
>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/aleejandrof/anaconda3/lib/python3.7/site-packages/wx/__init__.py", line 17, in <module>
later on, when I tried other ways like and "._core import" I received an error like this:
ImportError: /home/aleejandrof/anaconda3/bin/../lib/libpangoft2-1.0.so.0: undefined symbol: pango_font_description_set_variations
After reading some posts here, I tried deleting the wx.py and wx.pyc files, which didn't work. The same happened when I read that downloading the main excecutable file would make the import occur with no errors, but it popped the same errors.
AttributeError: module 'wx' has no attribute '__version__'
I am trying to run a GUI pipeline, which works with wxPython. I'm thankful in advance, if any of you has suggestions.
When I made an environment of ubuntu18.04 using docker, ran into the same problem.
I had multiple libpangoft2-1.0.so.0 files.
It seemed the problem was /opt/conda/lib/libpangoft2-1.0.so.0 was looked up.
To change the name of the file solved the problem.
find / -name libpangoft2-1.0.so.0
/opt/conda/lib/libpangoft2-1.0.so.0
/opt/conda/pkgs/pango-1.42.4-h049681c_0/lib/libpangoft2-1.0.so.0
/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
mv /opt/conda/lib/libpangoft2-1.0.so.0 /opt/conda/lib/libpangoft2-1.0.so.0-void
You may want to try:
conda install -c asmeurer pango

"No module named 'osmium._osmium'" error when trying to use PyOsmium

I am trying to use PyOsmium but it will not import. python3 setup.py install appears to complete just fine but when I import osmium I get the error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/dylan/Downloads/osmium/osmium/__init__.py", line 1, in <module>
from ._osmium import *
ImportError: No module named 'osmium._osmium'
I have no idea what's causing this and it's my first time manually installing a C++ wrapper. I have the top-level PyOsmium and libosmium directories in the same directory. Is it trying to import the C++ files?
Any help would be much appreciated.
I had the same problem. The solution, as provided by one of the maintainers, is very easy:
Are you in the pyosmium root directory while trying the import? Change the directory to somewhere else and try again. In the root directory the local osmium source directory takes precedence over your freshly installed version.
Change to a different directory from the one you compiled in and it should work; it did for me.

Import error in Python: Polygon

I installed this library called Polygon, in Python 2.7.3. But, each time I import it I get the next error message :
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "Polygon/__init__.py", line 5, in <module>
from Polygon.cPolygon import *
ImportError: No module named cPolygon
I have no idea about what could be going wrong. And also, I have already tried to contact the original author of this on his personal webpage.
but he hasn't replied though :( I wonder if someone can help me with this issue please.
It sounds like you didn't in fact install it, but instead just copied it to your working directory. As always, run setup.py with the appropriate arguments to install.
This error can happen if you try to run python from inside the directory you used to install Polygon. Move to a different directory and try again.

Categories