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
Related
I am having trouble importing a library called pymssql.
I have read previous solutions regarding this issue on stack overflow. The following are the solutions that did not work:
Error importing pymssql
import pymssql Unicode DecodeError in windows 7
I am running a conda virtual environment with Python 3.7.9. The following is the output when I run python in the terminal.
Python 3.7.9 (default, Aug 31 2020, 07:22:35)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
So, this confirmed that I was using the correct Python version. Next, I tried to import a library called pymssql.
This looked like:
>>> import pymssql
This returned an error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/anaconda3/envs/conda_env/lib/python3.7/site-packages/pymssql/__init__.py", line 3, in <module>
from ._pymssql import *
File "src/pymssql/_pymssql.pyx", line 1, in init pymssql._pymssql
ImportError: dlopen(/usr/local/anaconda3/envs/conda_env/lib/python3.7/site-packages/pymssql/_mssql.cpython-37m-darwin.so, 2): Symbol not found: _iconv
Referenced from: /usr/local/anaconda3/envs/conda_env/lib/python3.7/site-packages/pymssql/_mssql.cpython-37m-darwin.so
Expected in: flat namespace
in /usr/local/anaconda3/envs/conda_env/lib/python3.7/site-packages/pymssql/_mssql.cpython-37m-darwin.so
>>>
I have tried conda install pymssql and pip install pymssql. Neither of these solved the issue.
Recently installed a github package through conda in windows that has created a new Python environment.
Whenever I try to run Spyder in the new environment I get the following error:
Error processing line 1 of C:\Users\cip18jjp\Anaconda3\envs\ox\lib\site-packages\matplotlib-3.2.1-py3.8-nspkg.pth:
Traceback (most recent call last):
File "C:\Users\cip18jjp\Anaconda3\\Lib\site.py", line 168, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "C:\Users\cip18jjp\Anaconda3\Lib\importlib\__init__.py", line 51, in <module>
_w_long = _bootstrap_external._w_long
AttributeError: module 'importlib._bootstrap_external' has no attribute '_w_long'
Remainder of file ignored
Python 3.8.2 | packaged by conda-forge | (default, Mar 23 2020, 17:32:17) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
osmnx and the command as given on the github page: conda config --prepend channels conda-forge conda create -n ox --strict-channel-priority osmnx
Solved: Path variable in windows pointed to some different Python file locations.
This is because python and pip are installed on different sources. For more info, please look at the following post
using pip3: module "importlib._bootstrap" has no attribute "SourceFileLoader"
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?
I have installed jenkins module in the VM but still not able import the module and use.
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import jenkins
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/jenkins.py", line 9, in <module>
lookup3 = cdll.LoadLibrary(os.path.join(get_python_lib(), "lookup3.so"))
File "/usr/lib64/python2.7/ctypes/__init__.py", line 438, in LoadLibrary
return self._dlltype(name)
File "/usr/lib64/python2.7/ctypes/__init__.py", line 360, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/python2.7/site-packages/lookup3.so: cannot open shared object file: No such file or directory
Have you installed jenkins by this command?
pip install jenkins
if yes you should try to install it with
pip install python-jenkins
Ref: Bug
This is already answered by Daniel Salinas (imsplitbit) on lunchpad at
bug in jenkins lib
Close this bug, it appears pip was installing jenkins 1.0.2 not python-jenkins 0.2 which is actually used. These two modules use the same module namespace so it may be valuable to change that some how or even just add python-jenkins to the pip-requires so that this isn't an issue to begin with.
I just met it. That's how it was solved
$ pip uninstall jenkins
Uninstalling jenkins-1.0.2:
/usr/local/lib64/python3.6/site-packages/__pycache__/jenkins.cpython-36.pyc
/usr/local/lib64/python3.6/site-packages/jenkins-1.0.2-py3.6.egg-info
/usr/local/lib64/python3.6/site-packages/jenkins.py
/usr/local/lib64/python3.6/site-packages/lookup3.cpython-36m-x86_64-linux-gnu.so
Proceed (y/n)?
here is a file: lookup3.cpython-36m-x86_64-linux-gnu.so, soft connection to the corresponding position is OK
sudo ln -s /usr/local/lib64/python3.6/site-packages/lookup3.cpython-36m-x86_64-linux-gnu.so /usr/lib/python3.6/site-packages/lookup3.so
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.