PyTouchBar: no module named Foundation - python

I installed PyTouchBar using pip3
When I tried to import it, however, it gives me this error.
$ python3
>>> import PyTouchBar
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyTouchBar/__init__.py", line 5, in <module>
from .TouchBar import *
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyTouchBar/TouchBar.py", line 13, in <module>
from Foundation import *
ModuleNotFoundError: No module named 'Foundation'
On Python 2, Foundation works perfectly, by the way.
Could someone tell me how to fix this? Thanks in advance!

I think your problem could be one of these:
You installed PyTouchBar on python2 instead of python3, in which case you have to use:
pip3 install PyTouchBar
You are using a venv and installed from the terminal/command line instead of the venv's terminal
PyTouchBar uses foundation that you have to install separately

Related

$pip command gets ImportError: No module named typing

When I am trying to run the following command:
$ pip
I get:
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
File "/home/ssm-user/.local/lib/python2.7/site-packages/pip/__init__.py", line 1, in <module>
from typing import List, Optional
ImportError: No module named typing
Does anyone knows how to solve the issue? Thanks!
Here are my python versions:
$ python2 -V
Python 2.7.12
$ python3 -V
Python 3.5.2
Turns out the issue is the same as this. I followed the solution and downgraded pip and that solves the issue.

ModuleNotFoundError: No module named 'future'

I have a Python script that I am trying to run in Linux via a bash script called ./launch.sh. When I launch the code I get the following error returned.
[user#localhost mktdata.out]$ ./launch.sh
[user#localhost mktdata.out]$ Traceback (most recent call last):
File "strats/merlin.py", line 10, in <module>
File "strats/merlin/mktdata.py", line 11, in <module>
File "strats/dao/utils/itertools.py", line 1, in <module>
ModuleNotFoundError: No module named 'future'
Line 1 in the Python script itertools.py line 1 that the error is referring to is:
from future.moves.itertools import zip_longest
Is there a package that I need to install in order for this code to work?
You need to import future like this:
from __future__ import *
In the event that fails, use pip to install it like this (Use sudo for MAC):
pip install future
Here is more on installing future.

ImportError while running python program

I have tried all the import methods and upgrading the libraries but still I'm unable to get over this error. I have downloaded and installed all the nltk and corpus data programmatically and it is working in the python shell but i'm getting error.
Traceback (most recent call last):
File "spark.py", line 7, in <module>
from textblob_aptagger import PerceptronTagger
File "/usr/local/lib/python2.7/dist-packages/textblob_aptagger/__init__.py", line 8, in <module>
from textblob_aptagger.taggers import PerceptronTagger
File "/usr/local/lib/python2.7/dist-packages/textblob_aptagger/taggers.py", line 10, in <module>
from textblob.packages import nltk
ImportError: No module named packages
Here's a pastebin to my code and imports..
Same error has been posted on github here. Use this instead to install textblob:
$ pip install -U git+https://github.com/sloria/textblob-aptagger.git#dev
Also, you should change from text.blob import TextBlob as tbto from textblob...
Works for me..

installation wxPython on Ubuntu 11.10

hope somebody helps me to install wxPython.
I have ubuntu 11.10 and there is no build package for it.
I used this page ( http://wxpython.org/BUILD.html ) as guidance to install
after installing, I run
>python
>>>import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "wx/__init__.py", line 45, in <module>
from wx._core import *
File "wx/_core.py", line 4, in <module>
import _core_
ImportError: libwx_gtk2u_adv-2.9.so.3: cannot open shared object file: No such file or directory
What should do to fix it?
thank you!
Follow the instructions for installing on Ubuntu or Debian.
EDIT: Actually, you don't even need to do that, since it's in the main repos:
sudo aptitude install python-wxgtk2.8

pySerial not working on Python3.2.2

I installed the 32 bit version of Python 3.2.2 and want to get the pySerial package to work. I most definitely have the pyWin32 package install but still when I try to import serial it gives me this error
>>> import serial
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python32\lib\site-packages\serial\__init__.py", line 19, in <module>
from serialwin32 import *
ImportError: No module named serialwin32
>>>
Any help?
Search around in your C:/Python32/Lib/site-packages/serial/. See if you can find a file named serialwin32. If not, you should try uninstalling pywin32 and reinstalling it.

Categories