activestate pythonwin missing import modules? - python

I'm working my way through DiveIntoPython.com and I'm having trouble getting the import to work. I've installed ActiveState's Pythonwin on a windows xp prof environment.
In the website, there is an exercise which involves 'import odbchelper' and odbchelper.name
http://www.diveintopython.org/getting_to_know_python/testing_modules.html
When I run it interactive, i get:
>>> import odbchelper
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
ImportError: No module named odbchelper
>>> odbchelper.__name__
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
NameError: name 'odbchelper' is not defined
I'm guessing either i don't have the pathing set correctly or the module does not exist referenced in one of the folders when I run 'sys.path'. Any ideas?
thanks in advance

This module doesn't come packaged with Python2.6 for sure (just tried on my machine). Have you tried googling where this module might be?
Consider this post.

figured it out..
found this:
http://www.faqs.org/docs/diveintopython/odbchelper_divein.html
downloaded the file and then put it into a folder. c:\temp\python\ in my case with the commands:
>> import sys
>> sys.path.append('c:\\temp\\python\\')

Related

I can't run Custom-Widgets for PyQt5, how can I solve it?

I tried to simplify my code with the tool Custom-Widgets, I want to custom a animated menu, after the installation of Custom-Widgets from https://github.com/KhamisiKibet/QT-PyQt-PySide-Custom-Widgets
I try to prove it with the demo:
from Custom_Widgets.ProgressIndicator import test
test.main()
but It doesn't find the package of this.
I had this output:
Traceback (most recent call last):
File "c:\Users\user\Desktop\try\provePyQT.py", line 1, in <module>
import Custom_Widgets
ModuleNotFoundError: No module named 'Custom_Widgets'
What can I do with this error?

Don't understand these ModuleNotFound errors

I am a beginner and learning Python. I have setup the environment with SublimeText and Python3.x
I am fine in creating code on Sublime and building it locally through Ctrl+B and for input() function I installed SublimeREPL and it works find up till now.
The issue I am facing is on Python interpreter. I am facing below error while import any package:
import tweepy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tweepy'
I cannot even run a Python script from there. My Python path is below:
C:\Users\waqas.FVC\AppData\Local\Programs\Python\Python37-32
Demo.py and hello.py are the two scripts I wrote initially which I am trying to execute from Python Terminal, but it is showing below errors:
test.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'test' is not defined
Demo.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'Demo' is not defined
The initial Python download includes a number of libraries, but there are many, many more that must be downloaded and installed separately. Tweepy is among those libraries.
You can find, and download, tweepy from here:
https://pypi.org/project/tweepy/

How to reinstall or fix Python interpreter for XCode lldb?

I got this message at XCode after deleting some system files.
(lldb) script
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_python_interpreter' is not defined
P.S. Had to reinstall XCode, but I've got same message at debugger after reinstalling IDE
Terminal output
$ lldb
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 52, in <module>
import weakref
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref
You have a local installation of python on your computer (in /usr/local/Cellar). There's a problem when you have two different pythons on your system; lldb links against /System/Library/Frameworks/Python.framework but that python somehow ends up using the python libraries from your installed copy instead. I saw someone work around this once but I forget if it was by putting their local python last in $PATH or if they un-set their $PYTHONPATH before starting lldb.

Python Path error - No Module Found error

I'm having issues running ortools on Linux. I downloaded it from google's site (https://developers.google.com/optimization/) and installed it using "make install," but when I go to use it in python I get the following:
Traceback (most recent call last):
File "regular.py", line 42, in <module>
from ortools.constraint_solver import pywrapcp
File "/home/m3/summer/ortools_examples/examples/python/ortools.py", line 2, in <module>
ImportError: No module named linear_solver
It looks like despite installing ortools, its still not in my python path correctly, so when I call it in the file, it doesn't find anything and returns an error, right? Any advice on how to solve this?

python, libsvn and cant file python imports

I have installed libsvm-3.12 and placed into:
/home/ubuntu/libsvm-3.12
In my pythonpath I have the following:
echo $PYTHONPATH
/home/ubuntu/libsvm-3.12/python:/home/ubuntu/libsvm-3.12:$PYTHONPATH
This is in both .bashrc in home and in /etc/enviroments
I rebooted the machine.
From python I get:
>>> import svmulti
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named svmulti
How do I let python know where the lib is?
Given installation via make in .../libsvm-3.12/python,I think you also want:
>>> import svmutil
not:
>>> import svmulti

Categories

Resources