Using Anaconda Python 3.4 with PyQt5 - matplotlib

I have an existing PyQt5/Python3.4 application that works great, and would now like to add "real-time" data graphing to it. Since matplotlib installation specifically looks for Python 3.2, and NumPhy / ipython each have there own Python version requirements, I thought I'd use a python distribution to avoid confusion.
But out of all the distros (pythonxy, winpython, canopy epd) Anaconda is the only one that supports Python 3.4, however it only has PyQt 4.10.4. Is there a way I can install Anaconda, and use matplotlib from within my existing PyQt5 gui app?
Would I be better off just using another charting package (pyqtgraph, pyqwt, guiqwt, chaco, etc) that might work out of the box with PyQt5/Python3.4?

I was able to install it from dsdale24's and asmeurer's channels but then, when trying to run a qt script with a QApplication object, I got an error message regarding to cocoa library not being found.
Then, following asmeurer's comment, I could install PyQt5 on anaconda with python 3.4 using the mmcauliffe package:
conda install -c https://conda.anaconda.org/mmcauliffe pyqt5
Now it works great!

We are working on adding pyqt5, but for now, you can install it from https://binstar.org/dsdale24/pyqt5.
conda config --add channels dsdale24
conda install pyqt5

create an env like this:
conda create –name my_env python=3.5 pyqt=5
works great.

I use Anaconda and with Python v2.7.X and qt5 doesn't work. The work-around I found was
Tools -> Preferences -> Python console -> External modules -> Library: PySlide

Related

Where is the sipconfig module to make QT5 bindings for PyQT5?

I'm trying to build PyQt5 bindings for some C++ QT5 code. I've tried following the answer here:
Is it possible to embed C++ widget to PyQt application?
The code in the linked repo relies on the sipconfig module, but I haven't been able to figure out where / how to get this module.
Is the sipconfig module still needed? The example code and documentation https://www.riverbankcomputing.com/static/Docs/sip/examples.html
for sip5 doesn't mention it.
sipconfig comes inside the sip package.
If you are using ubuntu's pyqt5 then install it with apt-get install python3-sip, otherwise use pip: python3 -m pip install sip.

Kivy App crash in Android but not in PC. Buildozer 'KeyError: 'kivy.garden.matplotlib''

Versions:
Python: 3.8.5
OS: Manjaro 20.04
Buildozer: 1.2.0
Kivy: 1.11.1
Description:
I want to plot graphic of matplotlib with command "from kivy.garden.matplotlib.backend_kivyagg import FigureCanvasKivyAgg" in .py file. This command works in PC but not in Android.
Spec file:
requirements: python3,kivy==2.0.0rc3,https://github.com/kivymd/KivyMD/archive/master.zip,sdl2_ttf==2.0.15, matplotlib
logcat | grep python
09-14 11:32:56.530 17786 18857 I python : KeyError: 'kivy.garden.matplotlib'
09-14 11:32:56.531 17786 18857 I python : Python for android ended.
As already stated by the error, you dont have the garden requirements. It works on your pc because you probably did:
garden install matplotlib
At some point in your pc hence you have the garden flower.But that is only half the problem. Thing is, kivy garden is now deprecated so you should stop using it, for now to use a garden flower in your app, you should do:
garden install --app some_flower
This is because garden flowers have been deprecated in favour of pip packages but not all of them have been moved to pypi so if your desired package hasnt been moved yet, use the command above otherwise, just install it normally with pip and ialso add it in your requirements.
The other major problem you have is that MATPLOTLIB WONT WORK IN ANDROID This has been a major issue and discussed for a while now but AFAIK no one is currently working on a fix,If you only need to plot a simple graph though,there is a garden package called graph, install it with:
python -m pip install https://github.com/kivy-garden/graph/archive/master.zip
Then use it in your app, this one is just python so it will work on android, tried and tezted by me. If you are wondering how to use it, there is an example on its README
You can then include that url in your requirements in buildozer(like you did with KivyMD
Quick Edit: Matplotlib now works great with kivy

Installing Pandas for PyPy on Alpine Linux?

As documented in the following question
, installing Pandas and Numpy is slow with Alpine Linux. For those using normal Python, there are workarounds that involve adding prebuilt versions of Pandas. However, these versions are for Python3. What is the best way to handle this with PyPy?
the solution would be to provide prebuilt versions for Alpine Linux. Someone has to do the work of building them and uploading to a public site. It seems the distro provides these for cpython, perhaps they could be convinced to do so for pypy as well.
New Versions of PyPy Already supports Pandas and Numpy
https://doc.pypy.org/en/latest/release-v5.9.0.html
So ,Official Image on docker should be supporting . So no need to build your Dockerfile from alpine
https://hub.docker.com/_/pypy
Do update first:
apk add --update py-pip
Or:
apk update
apk add py-pip
Or: install anaconda navigator : Click Here
Or: Last option : Click Here

Error when importing NumPy in PyCharm

I have installed NumPy using pip install and it's working fine while using it in the python interpreter on the command line. But whenever I try
import numpy in PyCharm it throws an error module not found.
I already set the right path in the project interpretor and the import numpy command is working fine with other IDEs such as Syder or Jupyter notebook but it doesn't work in PyCharm.
I found a YouTube video that worked for me in importing a package into PyCharm. First, click on the File menu, then click on Settings, then click on Project Interpreter. Look for a + sign to the right and click on that. That allows you to add a package. Then search for your package of choice (I wanted numpy) in the Search bar at the top. Click on the name, and then at the bottom click on Install Package. After a few minutes, it will say, package successfully installed, and sure enough it was. I was able to import numpy the usual way in PyCharm.
Did you install official Python or Anaconda/Miniconda?
I assume PyCharm created either a virtualenv or a conda env, or an isolated Python environment that does not have NumPy installed.
You should either use your global environment instead of virtualenv:
Settings, Project: project-name / Project Interpreter, https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html
Or install NumPy in your virtualenv or conda env.
This is more complicated. If you open Terminal in PyCharm and it says (project-name) in your prompt, try pip install numpy.

Tensorflow installation

Upon trying to install Tensorflow for conda environment, I encountered with the following error message, without any progress:
tensorflow-1.1.0-cp35-cp35mwin_amd64.whl is not a supported wheel on this platform
Have you tried uninstalling and re-installing TensorFlow using pip within your Conda environment? I.e.:
pip uninstall tensorflow
Followed by:
pip install tensorflow
If it doesn't work, the issue may be with your Python installation. TensorFlow only supports 64-bit Python 3.5+ on Windows (see more info here).
Perhaps you have Python's default installation, which comes in a 32-bit version. If that's the case, you can download the 64-bit Python 3.5 or later from here to run in your Conda environment and then you should be able to install/run TensorFlow without any issues.
Make sure that the Python version installed in the Environment is 3.5 not 3.6. Since 3.6 was released Conda automatically sets that version as default for python 3. However, it is still not supported by Tensorflow.
You can work using tensorflow library along with other essential libraries using the Dockerfile. Using Docker for environment are a good way to run experiments in reproducible manner as in this blog
You can also try using datmo in order setup environment and track machine learning projects for making it reproducible using datmo CLI tool.