Issue with plot model in Keras - graphviz

I have installed all the needed packages, but looks like plot_model still doe not work. I get the following error:
You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) for plot_model/model_to_dot to work.
But I have isntalled them both. Any idea how to go around this issue?

Related

Trying to Avoid Using Two Package Managers (pip and Poetry) for the Same Project

After a fair bit of thrashing, I successfully installed the Python Camelot PDF table extraction tool (https://pypi.org/project/camelot-py/) and it works for the intended purpose. But in order to get it to work, aside from having to correct a deprecated dependency (by editing pyproject.toml and setting PyPDF2 =”2.12.1”) I used pip to install Camelot from within a Poetry (my preferred package manager) environment- because I haven’t yet figured out any other way.
Since I’m very new to Python and package management (but not to programming) I have some holes in my basic understanding that I need to patch up. I thought that using two package managers on the same project in principle defeats the purpose of using package managers, so I feel like I’m lucky that it works. Would love some input on what I’m missing.
The documentation for Camelot provides instructions for installing via pip and conda (https://camelot-py.readthedocs.io/en/master/user/install-deps.html), but not Poetry. As I understand (or misunderstand) it, packages are added to Poetry environments via the pyproject.toml file and then calling "poetry install."
I updated pyrpoject.toml as follows, having identified the current Camelot version as 0.10.1 (camelot --version):
[tool.poetry.dependencies]
python = "^3.8"
PyPDF2 = "2.12.1"
camelot = "^0.9.0"
This led to the error:
Because camelot3 depends on camelot (^0.9.0) which doesn't match any versions, version solving failed.
Same problem if I set (camelot = "0.10.1"). So I took the Camelot reference out of pyproject.toml, and ran the following command from within my Poetry virtual environment:
pip install “camelot-py[base]”
I was able to successfully proceed from here, but that doesn’t feel right. Is it wrong to try to force this project into Poetry, and should I instead consider using different package managers for different projects? Am I misunderstanding how Poetry works? What else am I missing here?
Whenever you see pip install 'Something[extra]' you can replace it with poetry add 'Something[extra]'.
Alternatively you can write it directly in the pyproject.toml and then run poetry install instead:
[tool.poetry.dependencies]
# ...
Something = { extras = ["extra"] }
Note that in your question you wrote camelot in the pyproject.toml but it is camelot-py that you should have written.

How to install solaris (on colab or locally)?

I try since multiple days to install solaris (https://github.com/CosmiQ/solaris) locally, on google colab or on renkulab (https://renkulab.io/). Up to now, without any luck. I tried on all platform different approaches:
Creating a conda environment (as recommended by the authors)
Directly through pip
And also cloning the repository and access the folders and functions directly
All of these approaches failed so far. Mostly there is a wheel building error for GDAL. Which i have installed first. I do not find any proper documentation or other failure descriptions which makes me question myself... Maybe here someone has experience with this library?
I highly appreciate every hint.
Thanks a lot
Colab Setup
I can get it set up in Colab with the following:
First Cell: Install Mamba/Conda
!pip install -q condacolab
import condacolab
condacolab.install()
This will trigger a runtime restart - it does this on purpose.
Second Cell: Install Solaris prerequisites
I'm assuming we want the GPU-enabled version. If not, there is another YAML in the solaris repository for a CPU-only environment.
!wget https://raw.githubusercontent.com/CosmiQ/solaris/main/environment-gpu.yml
!mamba env update -n base -f environment-gpu.yml
Manually restart the runtime after this completes!
Third Cell: Install Solaris
!pip install solaris
That should be it. Following these steps, I could import the module and use the entrypoints, e.g.,
Module import ✅
import solaris
Example entrypoint ✅
!make_masks -h
There were some future deprecation warnings from NumPy about some syntax in the TensorFlow code, but otherwise, seems functional. However, I don't personally use this tool, so I don't know if there is more to verify.

trying to run a setup script in anaconda, getting error "No module named Cython.Build" after trying to install cython in multiple ways

Apologies if this is a duplicate post, I've looked around and can't figure out why my issue isn't being solved by other answers I've found. Using Anaconda, python 3.9, Windows 10.
I'm trying to run a setup.py script that includes "from Cython.Build import cythonize". When I run setup.py I get the "ImportError: No module named Cython.Build"
I have tried installing with pip, upgrading cython with pip and pip3, upgrading pip and trying again, installing/updating with conda, and I still am getting the error. When I check the cython version (cython -V) I can see that I have Cython version 0.29.28.
I'm assuming and hoping this is an obvious question/answer to someone out there. Apologies again if this is a redundant post, I'm still fairly new and just recently switched to windows/python from mac/matlab.
I also keep coming across a solution to install the Microsoft Visual C++ Build Tools? That doesn't really make sense to me as a solution, but I tried it. It was an 8GB commitment which seems kind of ridiculous.

Theano is missing modules

I am on windows 64bit, I have installed anaconda, and managed to create an environment with python 2.7
I have numpy, pylearn2, theano, and every package is built properly
I have been able to import all these modules, however I get some very esoteric messages when I try to complete the model, like
ImportError: Could not import pylearn2.models.softmax_regression but could import pylearn2.models. Original exception: No module named dnn
Then I tried to actually find the package in the installation, but inside the cuda folder, there is no module named dnn. Looking at github, I see that it should be there.
Why is theano missing modules? I installed using conda install theano, and it gave some suggestions, I have managed to pick the correct one.
I have uninstalled and installed theano many time, I can import it but I can never get the proper modules.
What is going wrong?
Ok, after a few days of search, it seems like Theano installed from anaconda is missing a lot of modules. However, installing theano by cloning the repository with
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
seems to resolve the issue. Since windows normally does not have git, it can be easily installed (seems to take care of the environment's path variable) from here
https://git-scm.com/download/win

How do I install Pyramid on Python 3.3 Windows 7 x64

I have been having a heck of a time trying to install Pyramid on my Python 3.3 Windows 7 x64 machine. I have done the following from scratch with no luck. I have double checked all of my install files:
Install python 3.3
Install Python for Windows extensions
Install Distribute 0.6.34 (latest)
easy_install Virtualenv
Activated my new virtualenv
easy_install pyramid
I followed Pyramid's install guide here while substituting Python32 for Python33:
easy_install pyramid finishes and puts the following egg files in my venv\liv\site-packages folder:
mako-0.7.3-py3.3.egg
pastedeploy-1.5.0-py3.3.egg
pyramid-1.4-py3.3.egg
repoze.lru-0.6-py3.3.egg
translationstring-1.1-py3.3.egg
venusian-1.0a7-py3.3.egg
webob-1.2.3-py3.3.egg
zope.deprecation-4.0.2-py3.3.egg
zope.interface-4.0.3-py3.3-win-amd64.egg
However the actual folders are still in the egg folders and not have been copied to the site-packages folder. Should they be? Seems like an incomplete installation to me because the code can't even see the import modules from those egg folders.
I try to run this test code and I get import errors.
As a test, I moved all the folders in the egg folders up one level so they are now in the site-packages folder. I run the test code and I get different import errors. In fact, I have done this whole install process at least 10 times today from scratch. The import errors can be different. It's almost like the pyramid install is getting corrupted or incomplete. However, the install always finishes with no errors.
Any ideas what is going on?
I've used pip for python and everything went fine, all dependencies were installed and
import pyramid
did not throw any error afterwards.
Have a look at http://pastebin.com/bdv1SK7k.
Note: to install pip you need to, ironically, call easy_install pip

Resources