Cannot get Scrapy to work on Mac Os Catalina - web

After trying to continuously trying to install and run scrapy, i have hit a wall and cannot figure out what else to do.
upon initialising venv within folder with python 3.6.12,
scrapy startproject scraperproj
i am presented with the following error
`ImportError: dlopen(/Users/adris/Desktop/webscraper/venv/lib/python3.6/site-packages/_cffi_backend.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/libffi/lib/libffi.7.dylib
Referenced from: /Users/adris/Desktop/webscraper/venv/lib/python3.6/site-packages/_cffi_backend.cpython-36m-darwin.so
Reason: Incompatible library version: _cffi_backend.cpython-36m-darwin.so requires version 9.0.0 or later, but libffi.7.dylib provides version 1.0.0`

after 8 hours of continuous efforts, i tried myself at pip installing via using pip3 seemed to do the job! all working now

Related

Getting Error When installing Kivy Modules

So to be honest I started to learn to code like two weeks ago. If anyone could help me with this problem that would be great!
so Basically when I try to install kivy-deps.angle, kivy-deps.glew, or kivy-deps.gstreamer I get a message like the one below.
ERROR: Could not find a version that satisfies the requirement kivy-deps.angle-dev==0.2.0 (from versions: none)
ERROR: No matching distribution found for kivy-deps.angle-dev==0.2.0
enter image description here
enter image description here
I Tried everything I could think of and of course the proposed solutions are a joke i get the same Error in the terminal, I have the latest version of pip
$ pip --version
pip 20.1.1 from /Users/colemanschnaak/Library/Python/3.7/lib/python/site-packages/pip (python 3.7)
Since Im using a mac I already have python 2.7 pre installed I tried switching the python3 to the default.(which wasted my time)
I saw online that some people just have to type
$ python3 -m pip install [kivy module name]
but that still didnt work.
since i just started getting in to coding thats all I can think of.
The current version kivy-deps.angle-dev 0.2.0 provides wheels for Python 3.6-3.8 for w32 and w64 only. No other wheels and no source code at PyPI.
If you need kivy-deps.angle-dev for a different Python or a different OS you have to compile from sources. If there is something to compile — I downloaded a wheel and didn't find any code inside it.

Error While installing packages in pycharm i.e pandas and all

I have just installed pycharm 2019 edition. I have already installed python 3.7 in my system. My normal python program in pycharm is running fine i.e. printing hello world but I am not able to install packages like pandas and all. its showing error. 2nd thing i am not able to see latest version of pip that is been shown in pycharm.
I have tried to do this with some changes in manage repositories but It didn't wokred
While clicking on pip its showing "Error loading package list:pypi.python.org" this error message.
I want to install packages but cant able to do it.
Please download Anaconda Distribution, which is basically made for pandas and all. You can use Spyder which is one of the best tools for Data Science. There you can easily install pandas.

openCV in python on Linux bombs out at show image [duplicate]

I'm having an error running simple code using cv2 module.
It's just:
import cv2
img = cv2.imread('sudoku.png',0)
cv2.imshow('image',img)
And it fails with the following error:
QObject::moveToThread: Current thread (0x1b74720) is not the object's thread (0x1e57d70).
Cannot move to target thread (0x1b74720)
I googled this error and tried a lot of things but it doesn't help. I tried installing without pip, I tried using step-by-step installation (from official OpenCV) but nothing helps.
When I run:
cv2.__version__
It returns 3.4.3
As noted already, the basis for this problem is discussed in opencv-python issue 46, and results from the duplication of the following libraries both on the host and the opencv-python distro libQtDBus libQtCore and libQtGui.
It has been lately addressed in the newest release of opencv-python. It is not a fix to the source code, rather the fix is to force pip to compile the newly available source via
pip install --no-binary opencv-python opencv-python
This will cause opencv-python to use the same libraries as the host, so the conflict no longer exists.
According to this issue posted on the OpenCV GitHub, this is a known issue that the developer states is damn near impossible to fix. It is apparently caused by a conflict in any Qt installations on the system with the Qt that is shipped with OpenCV. There are some suggestions floating around to remove the libqt5x11extras5 package from the system. This may fix it for some but anyone running these libraries on a Linux distribution that uses a window manager based on Qt will render their desktop environment unusable by removing this package (having tried it myself).
You can try building OpenCV from source using the WITH_GTK=ON option when running cmake which will use GTK instead of Qt, circumventing the conflict. However, this is hard to make use of in Python when using virtual environments.
I haven't spent the time to fully appreciate this problem, but as I understand this is caused by multiple conflicting versions of some plugin in the environment. I tried installing building opencv-python but there were errors with that approach. Another suggestion is to change your import order, but I've had mixed success with that, and I couldn't get it to work on a project today.
But I found a workaround that worked for me. Install opencv-python-headless instead of opencv-python. This will avoid installing the conflicting plugins. It may not work for you depending on what features of opencv you need.
$ pip uninstall opencv-python
$ pip install opencv-python-headless
The error was fixed on my system, by simply updating one library.
To find out where it is coming from, assuming Linux, try the following,
LD_DEBUG=files python -c "import cv2"
or,
LD_DEBUG=files python -c "import cv2 ; img = cv2.imread('myimage.png',0) ; cv2.imshow('image',img) ; cv2.waitKey(0)"
On my machine, it failed in one of the blas libraries. I updated that library and the code now runs without error.
This is an old bug you can find it discussed in a number of online communities.
My test code is as follows. Notably the error has not reoccurred, and apparently has nothing to do with Qt.
import cv2
img = cv2.imread('sudoku.png',0)
cv2.imshow('image',img)
cv2.waitKey(0)
To me, the solution to this problem was removing Anaconda, then installing pip followed by installing OpenCV with a simple pip install command.

Updating Python version from command prompt and Conversion from PyQt4 to PyQt5

Running: Ubuntu 16.04 and Python 3.5.2
So I ran a script which I found here: https://github.com/rferrazz/pyqt4topyqt5
in order to convert one of my projects built in PyQt4 into a PyQt5 project.
I ran the script and the conversion was made just fine with no errors. Essentially, everywhere QtGui() was used was changed to QtWidgets(). The only problem, when I try to run the new PyQt5 project I get the following error:
ImportError: /usr/local/lib/python3.5/dist-packages/PyQt5/QtGui.so: undefined symbol: PySlice_AdjustIndices
I am not positive but it seemed to me this would be a version error of some kind, which brings me to my questions. Is there a method of updating Python from 3.5 to the newest version release which I believe is 3.7 from the command prompt? Also, is the ImportError I got a version control issue like I believe it to be?
The solution to this problem ended up being a version problem from what I can tell. I installed py3.7 from source using pyenv, drove the script with that interpreter through PyCharm and was able to run it.

Sundials installed but not running in python with assimulo

Cheerio,
I am trying to use Assimulo 2.9. on a Mac OS X. For that I downloaded and installed sundials via cmake by creating a builddir to the Download file and ../Downloads/sundials-2.7.0 running
$cmake ../Downloads/sundials-2.7.0
$make
$make install
This should install everything in /usr/local.
It gives me no error warning when doing this. But when I am trying to use assimulo in python, following error message occurs:
from .sundials import IDA, CVode
ImportError: No module named sundials
Any suggestions?
Thank you very much.
The trick was to install everything through homebrew and get the missing sundials.so file. It seems that the current assimulo-2.9 distribution on pypi does not provide this shared object library and therefore triggers this error message.
I got the same error, in Anaconda(Ubuntu 18.04). I installed pyfmi first, and then installed the dependencies (assimulo, sundials) according to the error message. After everything was installed, the pyfmi was not working by running an fmu example.
But i uninstalled all the related software. Then i reinstalled everything with certain order. I found the order of installation matters, which are: sundials --> assimulo --> pyfmi.
Everything is good now.

Resources