I m using this line in my python code
from test.dtracedata import instances
in eclipse.
Python Version-2.7.15
Then it will show this error
importerror: no module named dtracedata
Related
I need to install/use paramiko in a server with python 2.7
I install paramiko with pip without any problem but, when i try to import it, it´s fails
The error is:
ImportError: /usr/lib64/python2.7/site-packages/_cffi_backend.so: undefined symbol: PyUnicodeUCS4_FromUnicode
It´s an old machine without any documentation, it´s a mess.... i use paramiko in other servers without any problem
import paramiko
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/paramiko/init.py", line 22, in
from paramiko.transport import SecurityOptions, Transport
File "/usr/lib/python2.7/site-packages/paramiko/transport.py", line 90, in
from paramiko.ed25519key import Ed25519Key
File "/usr/lib/python2.7/site-packages/paramiko/ed25519key.py", line 17, in
import bcrypt
File "/usr/lib64/python2.7/site-packages/bcrypt/init.py", line 25, in
from . import _bcrypt
ImportError: /usr/lib64/python2.7/site-packages/_cffi_backend.so: undefined symbol: PyUnicodeUCS4_FromUnicode
error message:
ImportError: /usr/lib64/python2.7/site-packages/_cffi_backend.so: undefined symbol: PyUnicodeUCS4_FromUnicode
I am using Scipy.stats to perform distribution fits on my data. It works perfectly on my machine. But when I package my script with Python source folder, python27.dll and try to run it on another machine (where python is not installed and I do not want to also) by invoking my script like below
Path/to/Python.exe Path/to/script.py
I get the follwing error
Traceback (most recent call last):
File "test2.py", line 2, in <module>
import scipy.stats
File "C:\Users\User\Desktop\Python27\lib\site-packages\scipy\stats\__init__.py
", line 344, in <module>
from .stats import *
File "C:\Users\User\Desktop\Python27\lib\site-packages\scipy\stats\stats.py",
line 173, in <module>
import scipy.special as special
File "C:\Users\User\Desktop\Python27\lib\site-packages\scipy\special\__init__.
py", line 636, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
My script is
import sys
import scipy.stats
import numpy
dataarray= [2.45, 3.67, 1.90, 2.56, 1.78, 2.67]
desc = scipy.stats.describe(dataarray)
print desc
This occurs only on Scipy import and scipy operations, all other imports and operations work fine. My purpose is to run this script in different machines without having to actually install python
I am getting following error
D:\pythongui>C:\Python27\python.exe D:/pythongui/controller/MainController.py
Traceback (most recent call last):
File "D:/pythongui/controller/MainController.py", line 5, in <module>
from view.MainView import Launcher
ImportError: No module named view.MainView
when I am executing the following command in terminal
C:\Python27\python.exe D:/pythongui/controller/MainController.py
But the same code is working in pycharm without any error.
My Directory structure is as follows :
I have tried following code
import GetMyIp as getMyIP
import sys
sys.path.append("view/MainView")
import Server as server
import view.MainView
When I run the following code, I got an AttributeError:
#!/usr/bin/env python
import threading
import time
def worker():
for i in range(10):
time.sleep(1) # Seconds
print i
threading.Thread(target=worker).start()
Error:
Traceback (most recent call last):
File "/home/yaa110/workspace/Python27/src/threading.py", line 3, in <module>
import threading
File "/home/yaa110/workspace/Python27/src/threading.py", line 11, in <module>
threading.Thread(target=worker).start()
AttributeError: 'module' object has no attribute 'Thread'
I run Python 2.7.5 on Ubuntu 13.10.
Moreover when I use python via terminal, then I got no Error by inputing codes line by line.
It looks like you've created a python file, or module in the current directory of this script which is titled threading or threading.py. This causes your import threading to import the wrong threading library; one where there is no Module named Thread in it!
Rename it and all should be ok. Running the script on my 2.7.2 worked just fine!
I'm getting a module import error.
My main file is /home/mininet/pythonscripts/import.py:
and my module file is /home/mininet/test/hello.py:
The error I'm getting is:
File "import.py", line 7, in <module> from test.hello import sqr,print_func
ImportError: No module named hello
i also added the __init__.py file in the module search path..please help!!
In order to import /home/mininet/test/hello.py as test.hello, you have to fulfill two requirements:
/home/mininet/test/__init__.py must exist to mark test as a package.
/home/mininet must be on sys.path so that Python finds test/hello.py when looking for test.hello.
Note that having /home/mininet/test on sys.path lets you import hello, but not import test.hello.