Orange3 model load in python - orange

I made model.pkcls in Orange3-3.32.0 GUI mode.
I want to load the model.pkcls created by Orange3 in Jupyter Notebook Python.
I ran Jupyter Notebook as administrator to install the Orange3 module.
!pip install Orange3
!pip3 install Orange3-Associate
import Orange
import pickle
model = pickle.load(open('model.pkcls', 'rb'))
To load model.pkcls created in Orange3. But I get an error called ModuleNotFoundError: No module named 'orangecontrib.text'
Before, I had a error ModuleNotFoundError: No module named 'orangecontrib'.
Then I found this. So I did !pip3 install Orange3-Associate.
And when I run it, I got this problem. No matter how much I search, I don't see this error. In this case, how to solve it? Or is there another way to load the model?

Related

No module named 'psycopg2' Error in Scrapy

When I use
import psycopg2
in Scrapy pipeline.py or spider.py I get the following error
ModuleNotFoundError: No module named 'psycopg2'
I know that the error is not valid, because I am running Django server with postgresql, using same venv which contains psycopg2. And also I can connect to db in a test file and enquiry as well. In addition I can run import psycopg2 in Scrapy shell with no issue. So it has puzzled me that I might be missing something,
I appreciate if someone can help me,
Since it took me hours, here is what I have found.
I tested both in windows and Linux Ubuntu, both had same error.
Apparently this is what is happening:
In windows I had Scrapy installed on Core, and in Ubuntu apparently Scrapy is already wrapped in.
I ran my crawler within venv, and it appeared that actually my Scrapy is not installed correctly in the venve. However, Since Scrapy was already in the PATH it was running from Core, where it was no psycopg2. So the above mentioned errors was actually come from come not venv.
Installing Scrapy looked like was very simple in venv at first. I checked that by trying Scrapy shell and it was running, but it was actually were running from the core again. Make sure that you have Scrapy in your pip freeze list in your venv. This is a link that has explained how to address some issues in installation.
You need to install psycopg2 in your virtualenv, issue the next command
pip install psycopg2

Jupyter cant run shapely.geometry

Hey so I've managed to get shapely.geometry to run just fine on PyCharm.
But the difficulty here is in getting the import to run on Jupyter notebook.
I have done:
import geopandas as gpd
This returns shapely.geometry doesn't exist.
I think I know how to fix this through downloading the file
"Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl" and doing conda install (that)... but it returned that the channel didnt exist...
So I did:
conda install --add channels https://www.lfd.uci.edu/~gohlke/pythonlibs/
(which is where I got the file from) which worked just fine so I then again did "conda install Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl" but it returned:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://www.lfd.uci.edu/~gohlke/pythonlibs/win-64/repodata.json>
A simple retry will get you on your way...
Tried that, didnt work. Someone please help. Reminder that I successfully installed shapely with all of its modules working through "pip install Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl" WITHIN Pycharm itself.
EDIT 1
Im following the textbook "Mastering Geospatial Anlsysis with Python" It got me to download the packages:
gdal
geos
shapely
fiona
pyshp
pyproj
rasterio
geopandas
EDIT 2
I dont know what i did but somehow i fixed it... but the thing is, i literally did nothing except take out a shapely file with a long name and kept the one just called "shapely".
If i have files like this
gdal-2.2.2-py36hcebd033_1
instead of this
gdal
Is that the problem?????? because if it is, then i dont know how to get files like that they just either appear or they dont.
Shapely is a wrapper of C++ library called GEOS that is not installed with the wheel. You should go to the page and install that library.
Or perhaps you have Pycharm for python 2 and Jupyter for python 3 (or vice-versa).
Running conda install -c conda-forge geos=3.7.1 worked for me.

Cannot import sparknlp on Databricks

I'm trying to do an
import sparknlp
on the Databricks platform and I'm getting a similar message to the one reported at After installing sparknlp, cannot import sparknlp
I can't figure out how to get the python wrapper installed... I can access the spark-nlp library via Scala but I can't get the python version working. Any tips would be greatly appreciated!
These error can be produced due to sparknlp jars have been loaded correctly, but python wrappers library can not be imported. Make sure you have installed those wrappers correctly. Check out the sparknlp documentation site
As is said in documentation webpage, make sure that after install python sparknlp library:
pip install --index-url https://test.pypi.org/simple/ spark-nlp==1.5.4
that your environment variable PYTHONPATH can locate sparknlp wrappers.

ImportError: No module named sympy

I am getting the following error while trying to run a sympy file in order to contribute to sympy. It is :
ImportError: No module named sympy
I installed the sympy module through pip for both python2.7 and python 3.
Also, isympy is working.
Strangly, when I try to import sympy in python's interactive console in the main sympy directory, no import errors are shown but in some other directory, it shows import errors.
Please help me to download the sympy module in a way that I will be able to run the code.
Thanks.
Importing module in python console of main directory.
Importing module in some other directory.
A likely cause here is that you are using two different Pythons. If you have Python installed multiple times (like Python 2 and Python 3), each has its own separate packages. You can check what Python you are using by printing sys.executable.
I should point out that for the purposes of contributing to SymPy, you generally want to run against the development version. That is, running Python from the SymPy directory and importing the development version from there, without actually installing it.
Thanks for the reply.
But I solved the problem. I realised that I didn't install sympy in the current conda environment. When I tried it using the command:
conda install sympy
It worked and no error is being shown.
Thanks.

Tcl wasn't properly installed on Anacondas

I have a fairly new install of Anaconda with Python 3.3, and am using Pydev.
When I try to use tkinter with
from tkinter import Tk
master = Tk() # create a Tk root widget, which is a window
I get the following message
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
C:/Anaconda/envs/p33/lib/tcl8.5 C:/Anaconda/envs/lib/tcl8.5 C:/Anaconda/lib/tcl8.5 C:/Anaconda/envs/library C:/Anaconda/library C:/Anaconda/tcl8.5.11/library C:/tcl8.5.11/library
This page (http://mail.python.org/pipermail/python-list/2011-March/599573.html) suggests that I need to change the TCL_LIBRARY environment variable. But I do not know how to do that.
How can I make tkinter work with my build?
This isn't a proper solution, but I got it to work by copying the folders
C:\Anaconda\envs\p33\tcl\tcl8.5
C:\Anaconda\envs\p33\tcl
to
C:\Anaconda\envs\p33\Lib