Intel DAAL python error - python

Intel Data Analytics Acceleration Library (Intel DAAL) has been installed successfully on my ubuntu. However, when running examples located at compilers_and_libraries_2017/linux/daal/examples/python/source/distance, I got following error. Anybody have this problem before?
$ source activate intelpython
(intelpython) W2600CR:/compilers_and_libraries_2017/linux/daal/examples/python/source/distance$
$ python3.5
Python 3.5.2 |Intel Corporation| (default, Feb 5 2017, 09:07:18)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>>
(intelpython)$ :/compilers_and_libraries_2017/linux/daal/examples/python/source/distance$ python3.5 cos*.py
Traceback (most recent call last):
File "cos_dist_dense_batch.py", line 48, in <module>
DataSourceIface.doDictionaryFromContext
File "/media/liqisuccess/76F07852F0781A97/Ubuntu/App/Anaconda3/envs/intelpython/lib/python3.5/site-packages/daal/data_management/__init__.py", line 4540, in __new__
return FileDataSource_CSVFeatureManagerFloat64(*args)
File "/media/liqisuccess/76F07852F0781A97/Ubuntu/App/Anaconda3/envs/intelpython/lib/python3.5/site-packages/daal/data_management/__init__.py", line 3534, in __init__
this = _data_management.new_FileDataSource_CSVFeatureManagerFloat64(*args)
SystemError: Error on file open

I ran into the same problem. After I dig into the sample source, I found that it's due to the csv file path.
Just cd to compilers_and_libraries_2017/linux/daal/examples/python and run the sample again.

Related

How to solve AttributeError: module 'uhd' has no attribute 'usrp'

I know it is a wide answered question, however, I could solve it. When I'm trying to execute the command
usrp = uhd.usrp.MultiUSRP()
from https://pysdr.org/content/usrp.html I get this error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'uhd' has no attribute 'usrp'
I've executed:
export PYTHONPATH="/usr/local/lib/python3.8/site-packages/"
Inside lib I have:
/use/local/lib/python3.8/site-packages$ ls
uhd usrp_mpm
Inside uhd there are the following files (including usrp):
/usr/local/lib/python3.8/site-packages/uhd$ ls
chdr.py imgbuilder property_tree.py usrp
dsp __init__.py rfnoc.py usrpctl
filters.py libpyuhd.cpython-38-x86_64-linux-gnu.so types.py utils
And inside usrp:
/usr/local/lib/python3.8/site-packages/uhd/usrp$ ls
cal __init__.py libtypes.py multi_usrp.py
The version of python is:
Python 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
The SO is:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
Anything missing?

Cannot use socket

I am trying to import socket and I get the following error:
$ python
Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 16:24:02)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "socket.py", line 68, in <module>
from _ssl import \
ImportError: cannot import name RAND_egd
I thought that perhaps my Anaconda installation was corrupted so I uninstalled and reinstalled Anaconda but the error persists.
I had tried what the other posts suggested except for editing socket.py due to Macos System Integrity Protection. My guess is that the problem lies elsewhere as I doubt that everyone has had to edit the file.
How can I find the source of the problem?

Error with pattern while running example pattern.web.HTTP403Forbidden

I am working with Debian. I have installed Anaconda, then I created a virtual environment with Python2.7, and finally according with Pattern Anaconda Cloud I installed pattern by typing conda install -c asmeurer pattern
When I try to run the first example from here Pattern Clips I have the followinf error:
Python 2.7.14 |Anaconda custom (64-bit)| (default, Dec 7 2017, 17:05:42)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pattern.web import Twitter, plaintext
>>> twitter = Twitter(language='en')
>>> for tweet in twitter.search('"more important than"', cached=False):
... print plaintext(tweet.text)
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/anaconda3/envs/venv27/lib/python2.7/site-packages/pattern/web/__init__.py", line 1471, in search
data = url.download(cached=cached, **kwargs)
File "/home/user/anaconda3/envs/venv27/lib/python2.7/site-packages/pattern/web/__init__.py", line 420, in download
data = self.open(timeout, proxy, user_agent, referrer, authentication).read()
File "/home/user/anaconda3/envs/venv27/lib/python2.7/site-packages/pattern/web/__init__.py", line 381, in open
if e.code == 403: raise HTTP403Forbidden(src=e)
pattern.web.HTTP403Forbidden
>>>
Any idea what is happening ? Thank you in advance
I solve the problem by installing Pattern directly from github. In order to do so I had to remove the Pattern version I had already installed in my virtual environment by conda remove pattern and then pip install git+git://github.com/clips/pattern

How come Pylons is not recognized when I run 'import pylons' in Windows Vista command prompt?

When I try to import pylons in the virtual python environment I get the error
C:\env\Scripts>python
Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (A
MD64)] on win32
Type "help", "copyright", "credits" or "license" for more informati
on.
>>> import pylons
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\env\lib\site-packages\pylons-1.0-py2.7.egg\pylons\__init
__.py", line 6, in <module>
from paste.registry import StackedObjectProxy
ImportError: No module named registry
As I understand this error, Python is telling me that it can not find the module named registry. Perhaps this is a result of the error I got while installing Pylons which is explained over here Why do I get an error on the last line of installing Pylons 1.0 with easy_install and Python 2.7 in Windows Vista 64?
It seems that many of the Pylon components were installed but I guess registry was not or maybe Pylons just can not see it.
Any ideas on how to solve this?
You have to activate the virtual environment before you can import pylons.
C:\Users\Josh>env\scripts\activate
(env) C:\Users\Josh>python
ActivePython 2.6.2.2 (ActiveState Software Inc.) based on
Python 2.6.2 (r262:71600, Apr 21 2009, 15:05:37) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylons
>>>
vs. this
C:\Users\Josh\env\Scripts>python
ActivePython 2.6.2.2 (ActiveState Software Inc.) based on
Python 2.6.2 (r262:71600, Apr 21 2009, 15:05:37) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> pylons
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'pylons' is not defined
>>>
I guessing that you have the pylons package installed outside and inside your virtual environment. So python is letting you import pylons but the paste package is not installed outside of your virtual environment so you are getting an error.
Running the activate batch script (should be inside your env\Scripts folder) should solve the problem.

Problems on select module on Python 2.5

I have an application in Python 2.5 that listens to a beanstalk queue. It works fine on all machines I tested so far, except from my newly acquired MacBook Pro.
On that computer, when I try to run it I get this error:
Traceback (most recent call last):
File "jobs.py", line 181, in <module>
Jobs().start()
File "jobs.py", line 154, in start
self.jobQueue = Queue()
File "src/utils/queue.py", line 16, in __init__
self.connection = serverconn.ServerConn(self.server, self.port)
File "src/beanstalk/serverconn.py", line 25, in __init__
self.poller = select.poll()
AttributeError: 'module' object has no attribute 'poll'
The serverconn.py has the following imports:
import socket, select
And when I try to run it from command line, it fails as well:
Python 2.5.1 (r251:54863, Jul 23 2008, 11:00:16)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import select
>>> select.poll()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'poll'
Do you have any idea on what can be happening?
PS: Even though I am pretty confident it's not a source problem, if you need some background on the source that's failing, it's available at [http://pastie.org/399342](this pastie).
Updated: since the first answer I got speculates whether select.poll() is or not supported on Mac OS, but I have an iMac too and with the exact same OS version and it works fine:
2009-02-25 00:27:10,067 - Queue - DEBUG - Connecting to BeansTalk daemon # localhost:11300
According to this macports ticket Apple's implementation of poll() is straight up broken. Apple worked around this by disabling poll() in Python and macports now disables poll in their Pythons as well. I think this means you need to look into Python's select.kevent() instead of poll on mac.
I think your answer is here
http://atomized.org/2008/12/python-on-os-x-leopard-lacks-selectpoll/
use the MacPorts version of python on your MBP.
Mac OS X supports this. Apple stock Leopard python 2.5.1 does not.
you will want to download and install MacPorts if you have not already. FYI, I find Porticus to be an excellent GUI around MacPorts.
here is a comparison of stock Leopard python vs. latest MacPorts python2.5...
Leopard python from Apple (python 2.5.1) - select.poll() broken
$ /usr/bin/python
Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket, select
>>> select.poll()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'poll'
>>>
Macports (python 2.5.4) - select.poll() works!
$ /opt/local/bin/python2.5
Python 2.5.4 (r254:67916, Feb 3 2009, 21:40:31)
[GCC 4.0.1 (Apple Inc. build 5488)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket, select
>>> select.poll()
<select.poll object at 0x11128>
>>>
select.poll()
(Not supported by all operating systems.) Returns a polling object, which supports registering and unregistering file descriptors, and then polling them for I/O events; see section Polling Objects below for the methods supported by polling objects.
My guess is that it's not supported on the macOS.

Categories

Resources