EnvironmentError: Gmsh version must be >= 2.0 - python

I am new to fipy, so excuse my ignorance if I ask something that should be obvious. But I fail to run an already existing (and working - on other machines) script, getting the EnvironmentError: Gmsh version must be >= 2.0. I may have missed something during the installation? Fipy manual is a bit vague about implementation of gmsh. It only provides the link to download file and that meshes can be generated by it, but it doesn't say WHERE gmsh should be installed (so I have my gmsh-3.0.3-Windows in the default, i.e. in Program Files (x86). Should it be installed in some particular directory, perhaps the same as fipy?
(I really apologise for a stupid question, but this is the case when if you know what question to ask, you already know the answer and don't need to ask at all.)
For completeness, I am running it on Windows 7, Python 2.7 from Anaconda distribution, fipy 3.1.3.

I see. I made a desperate try - copied the gmsh.exe file into ..Anaconda2/Scripts/ and it did the job!
I think the fipy documentation should mention this. The chapter on mesh generation only says that you need gmsh, but does not specify that the application (.exe) has to be in the directory with python modules. But this is not quite intuitive (it is not a python file, not installed by pip, just a downloaded application from the web) and yet it is essential for running it.

Related

GeoDjango - FileNotFoundError: Could not find module 'C:\OSGeo4W\bin\gdal304.dll' (or one of its dependencies)

I am trying to install GeoDjango what turns out to be much harder than I thought. After I installed the OSGeo4W on my 64 Bit Windows 10 system I set everything up in the settings.py file but now I get this error:
FileNotFoundError: Could not find module 'C:\OSGeo4W\bin\gdal304.dll' (or one of its dependencies). Try using the full path with constructor syntax.
I also set the GDAL_LIBRARY_PATH but it just won't work.
GDAL_LIBRARY_PATH = "C:\\OSGeo4W\\bin\\gdal304.dll"
This is my C:\OSGeo4W\bin path and as you can see the gdal304.dll file is there
My Python is on version 3.10.6
Django is on version 4.1
I already tried to solve it by myself for a week but slowly I have no idea left on what to do
I ran into this problem too, since I updated my old GEO Django Setup today.
You may use a Docker Image as suggested by the others, but I prefere a native solution, since I don't want to spin up Docker every time I start coding.
Your solution is in the brackets: (or one of its dependencies)
You may look up the transitive dependendencies from gdal304.dll. There are several tools for this (see here). I'm using here now the Git integrated MinGW - Shell that has ldd installed. This should be the case for any (newer) Git installation on Windows.
As you can see, some dependencies are already fullfilled from your operating system. Others that are missing, have to be fullfilled from OSGeo4W. If you compare this with your bin directory from OSGeo4W you will see the Problem:
Sadly a simple "renaming" does not the trick. I was lucky and had not yet deleted my old OSGeo4W version. In the old files I then found the necessary DLL.
So, long story short: You need the jpeg.dll file.
There are sites like "windll.com" or "dll-files.com", but I would not recommend using them. I don't trust these sites. You may install something like "MSYS2", "Cygwin" or even "MVSC", install the "libjpeg-turbo" library and then finally copy & paste the necessary DLL file.
This is also suggested on the official Site for libjpeg-turbo: https://libjpeg-turbo.org/Documentation/OfficialBinaries
But this seems like a lot of work for someone who just want to have the DLL file, but then again: Never download a library blindly from the Internet and load it into your application. These libraries could do anthing!

Kivy installation python 2.7 windows 10

I want to develop python 2.7 app using Kivy library on Windows 10, but I do not know how to install it. I have tried to install Cython,Pygame and then Kivy.But it did not work. I have reinstalled all these things like Cython,Kivy,Python... And now I want to install it from the beginning. How can I install Kivy?
Your answers will be very appreciated.
Kivy changed a little bit since 1.8.0, use the new instructions if you have pdf docs, or some kind of book. So... the default provider is sdl2 now(pygame isn't necessary). Also, there's no need for compiling since there are wheels, so even cython and mingw aren't necessary(if you don't code with them). The only thing you need is python installed correctly.
At first of all you should visit main page and especially documentation where is described quite well what is needed and what you should install, yet still someone comes with missing dlls or something, therefore read it carefully. Or grab a tool.
But really, use the docs, most of the stuff is documented either in docs or here(examples, problems,...). No one's going to read it for you. :)

How to package/ distribute python applications

I've spent countless hours trying to understand this and unfortunately I haven't gotten to an answer yet. Or at least I don't think I have.
First up I should say that I am a Java Developer. I've only recently started working with Python and the build-process is a bit...odd for me.
In my mind I write an application, I compile it to run and I package it into a .jar for other people to use. Either as a library or for end-users to execute and have fun with it. (ignoring stuff like maven or gradle...)
I wrote a little CLT in python that consists of ~6 files and I wanted to distribute it. From what I could find I was supposed to write a setup.py and I found some guides on how to do that but ... to be honest I'm not even sure what that did. I could get my source code bundled into a tar.gz with some other meta data or it would create some weird files that I don't know what to do with.
Then I found PyInstaller and it worked great to package everything into a binary. However I've run into some problems trying to create a Debian package and it has made me re-assess and question the fact that there doesn't seem to be something in Python (without having to use an external tool) that lets me package/ bundle/ whatever my application into a single file to be run.
And that's something I can't get my head around. I mean...before there were tools like PyInstaller and P2Exe and what not, how did people distribute their applications? Am I expected to write a C application, somehow include the python code in there and compile that? Sorry if this seems like a stupid question but I'm really asking. I've googled around so much and spent so much time on it and haven't found a satisfactory answer so I hope someone here can help me with this! Thanks.
If you package your Python code for pip, you can include some executable scripts that start your program. I don't know how the situation was 5 years ago when this question got asked, but nowadays pip is pretty much integrated with Python, to the point that there's a standard library module to bootstrap pip in case it's missing:
https://docs.python.org/3/library/ensurepip.html
The situation is different if you want to package an application for some other package manager, like Anaconda or the package managers of various Linux distributions, or as a Windows installer. Obviously, you'll have to create a separate package for each package manager or installation technique you want to support.

Want to rework Python and add-ons for Mac OS X 10.7

I have been trying to graph with python for some time now. I want to use matplotlib, but have hit so many bumps in the road. Previously, numpy and matplotlib have been installed, but I am stuck with this error: ImportError: numpy.core.multiarray failed to import. I'm running Lion on Mac. I think I'm using Python 2.7. I have also tried full walkthroughs, such as this as well: http://penandpants.com/2012/02/24/install-python/. After several installation methods like pip and homebrew I am afraid that there's a lot of knotted things going on with python on my computer. And I really don't know how to untangle it.
I am reasonably knowledgeable with programming and algorithms, but I lack the know-how on how all the add-ons such as matplotlib that connect with python or how a text editor that can execute my code like Sublime Text 2 accesses them. So, as much as I would like to aid this asking-a-question process by letting you know what versions I am using, I don't really know how. Any guidance to how python connects to these things would be really appreciated :)
Ultimately, I wish to start from scratch with this whole mess, reinstalling python and then matplotlib from the ground up--but I'm not totally sure how. So, I guess my final question is how do I do that, or if that is just a wrong line of thinking how do I proceed if I want to graph some mathy things with python?
Sorry for the long winded question, I'll appreciate any help even a nudge in the right direction in learning how my computer organizes python on my computer!
Thanks!
I've had similar problems and the best solution I found was to use MacPorts for managing python and my installed modules. The things that I particularly like about using MacPorts for this are:
You can easily install multiple python versions (with modules separately installed for each installation)
You can select which python installation is the default (whether it is one installed by MacPorts or your OS X python installation).
Many MacPorts packages have optional variants so you can easily customize how they are installed (e.g., should numpy use the ATLAS library from MacPorts or from OS X) .
If you screw up your installation, you can easily wipe MacPorts from your system without worrying about breaking anything (almost everything installed by MacPorts is put under /opt).

Error when installing pycrypto

I'm trying to install Fabric on my PC (with Windows + setuptools). It was giving me an error, since I have older version of pycrypto.
When I was trying to install latest version I stumble upon "Unable to find vcvarsall.bat" error. I googled something about MinGW, so I installed that too. I've added it to my Windows PATH, but now i'm getting another error, which looks like this: "command 'gcc' failed: no such file or directory." What do i do now? Found something about gcc-mingw, which is some version of MinGW that could help?
Why is has to be so damn complicated :D.
New development. Managed to install pycrytpo and fabric, but still can't run anything in the latter. New error says: "ImportError: no module named win32api". Quick google search says something about PyWin, but easy_install can't find it and it looks like it's abandoned. Any ideas?
Well, it's so complicated because C (C++? Can't remember what they used at the moment, but I am pretty sure they used C) is much, much better at math than Python, so the math pieces of PyCrypto are all written in C. It does have a _slowmath module if the compiled versions aren't available, but it's name is telling... it is much slower.
gcc is the GNU Compiler Collection (<!-- an edit, I had thought it stood for GNU C Compiler, but apparently my knowledge was dated). It is a bit legendary, but apparently your version of Windows has not heard of it. First question though, have you closed the "DOS prompt" and restart it? (it's in quotes because the people at superuser once yelled at me because I did not sufficiently acknowledge its inferiority) Environment Variables in Windows do not update during a "DOS session" (or whatever it is supposed to be called).
If you have, chances are that it can be found inside of the MingW install director -- if there is a bin folder I'd check there first. If not, I would search for gcc.exe and make sure that it's path is part of PATH. Then,
If all else fails, you might be able to get more info on MingW here.

Categories

Resources