Installing GDAL via poetry on mac getting EnvCommandError error - gdal

I've been trying to install GDAL via poetry on mac but i keep getting an EnvCommandError error. I've tried reinstalling command line tools on mac and i even tried this stack overflow solution where i could log in to poetry's shell, try installing poetry via pip through there and then try adding GDAL via poetry but i still get the same error. Going through the code, it's all repeating this error at different lines of code
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:138:32: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
Something about null values not allowed. I'm not exactly sure how to resolve this one. Has anyone encountered this error before with GDAL and poetry?
EDIT: This still isn't fixed yet but i tried installing via homebrew and the installation proceeded. From what i've been reading so far, it seems that the stdio.h that comes with xcode's command line tools isn't compatible with how gdal is setup so if i install via pip, the installation fails. Not sure though what homebrew does differently. Unfortunately, since poetry uses pip, not homebrew, this is not solved yet

Related

OSError: WinError 193 %1 is not a valid Win32 application

I have been working on a project in Visual Studio Code with Python 3.8.5, and I have a windows 64 bit operating system. I decided to upgrade to Python 3.11.1, and downloaded the official 64 bit installer and followed the instructions. All the packages I import at the beginning of my project that were previously working now give this error "[WinError 193] %1 is not a valid Win32 application" when I run the import statements for them.
For some of the packages (pandas, numpy, matploblib) this was solved by using an approach I saw on a few similar questions to this, by opening the command prompt and typing "pip uninstall pandas" etc and then doing "pip install pandas".
However, for the other packages (sklearn, umap, nltk), this isn't working even after trying that process a few times. I've also tried updating pip. Does anybody have any ideas on what could be causing this to work for some packages but not for others? It allows me to install all of the packages via the command prompt, the issue only arises when I actually try and import them via VSCode, and it's the same error for every package. I've seen some suggestions saying to ensure the environment path is clean, but I'm still quite a beginner so I'm a bit unsure as to what that means.
Any help would be really appreciated.

OCaml Error : Fatal error: exception Cmi_format.Error(_)

I'm using OCaml on my Windows device via Cygwin. I installed Opam as well, and also ran the command
opam pin add merlin --dev-repo
because after installing the most recent OCaml for Windows the compiler ocamlc wouldn't work and some Google searching offered this solution.
The error that I got when I first tried to run ocamlc was:
Error: C:\OCaml\lib/pervasives.cmi
is not a compiled interface for this version of OCaml.
It seems to be for an older version of OCaml.
However, now whenever I type "ocaml" in the terminal, rather than getting the interactive editor I get the fatal error message:
Fatal error: exception Cmi_format.Error(_)
Does anybody know what the problem might be? Thank you.
Installed two different versions of OCaml that weren't compatible.

SCIP Python Installation Issue Windows with pip

Hello community / developers,
I am currently trying to install SCIP with python and found that there is Windows Support and a pip installer based on https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.md.
Nevertheless I run into a problem "Cannot open include file"
Below is a list of the things I performed to get to this step.
Download Python Anaconda 2.7 64 bit
Install with all checkboxes as they are
Download PyCharm Community edition
Click 64 bit desktop link, and associate with .py checkboxes
Open CMD > write: easy_install -U pip
Download Visual C++ Compiler for Python 2.7
Setup folder structure and downloaded header files
CMD > pip install pyscipopt leads to error:
C:\Users\UserName\Downloads\SCIPOPTDIR\include\scip/def.h(32) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
error: command 'C:\Users\UserName\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
My environment variables and folder directory can be found here:
http://imgur.com/a/mJRva
Help is very much appreciated,
Kind regards
The error message says your missing "stdint.h". This is because you don't have a recent Visual Studio version. You probably use the one that came with your Python installation. Try installing the latest Visual Studio to fix this issue.
You might want to look at this question:
Why Microsoft Visual Studio cannot find <stdint.h>?
PySCIPOpt needs a C/C++ linker to build the Python module - although it's already precompiled on PyPI.
Alright, I figured it out. I needed to
(1) Install Python 3.6 instead of Python 2.7 (both Anaconda)
(2) Afterwards pip installation worked
(3) I moved the library files in the lib folder
(4) Now I can execute the examples.
Interestingly, I get an unresolved reference error although the code works fine (I assume this is a bug of Pycharm/scipy?) Link to picture: https://www.dropbox.com/s/d8pf6dkwuz9cwto/scip_python.png?dl=0

dyld: Library not loaded: #rpath/libxcrun.dylib referenced from xcrun

I'm relatively new to mac and now trying to setup a dev. environment for Cordova based iOS app. I'm using Yosemite 10.10.3
I've installed xcode 6.3.1 and the commandlinetools for 6.3.1, under /Applications/Xcode.app/Contents/Developer/ I can see usr/bin and usr/lib, also xcode-select -p is pointing to this path, so I think the command line tool is fine.
However, when I run xcodebuild I got command not found. I've manually added the path above into the PATH environment variable to make xcodebuild visible, but not sure why this is needed, I thought the installation should have taken care of this.
Then when xcrun was executed in certain script ( npm install -g ios-deploy ), I got the following error:
dyld: Library not loaded: #rpath/libxcrun.dylib referenced from /usr/bin/xcrun, reason: image not found.
I see xcrun is available in /usr/bin as well as in the usr/bin under command line tool installation path. But the libxcrun.dylib is only available in the installation path.
I manually copied this dynamic library to /usr/lib and xcrun worked.
Though it seemed working but I got suspicious, such manual actions shouldn't be the normal post-installation procedure, should they?
Is there something I forgot to do after the command line installation? What if there's more such little files I need to copy/move around? Can I simply specify the installation path somewhere?
BTW, I added the install path/usr/lib into PATH, but didn't work with xcrun, had to copy the .dylib.
There's other mac which the Xcode and CLT were upgraded from previous version, and there no such issue.
Well, after some try-out I've got ios-deploy installed by npm. I'm not sure if what I did is preferred resolution, to me it's more like a workaround.
First of all, as far as I see, if it was upgraded from previous version of CLT or Xcode, such issue doesn't exist, though all the executable behaviour are the same.
e.g. /usr/bin/xcrun will be used, and /usr/lib doesn't have libxcrun.dylib, while #executable_path=../lib, meaning xcrun is looking for library in the ../lib location.
Normally the library not loaded error is expected, but somehow with the upgraded case some hidden setting told xcrun to search for library in the correct path.
I've tried DYLD_LIBRARY_PATH, worked with gcc and xcrun but didn't work with npm install. I can only fix the error by copying the lib file to /usr/lib at the moment.
Well, I'm still getting "cannot infer developer directory from our own path (/usr/bin/xcrun)" warning, even though I've set DEVELOPER_DIR to the correct one, and xcode-select -p shows the same.
But this warning seems not doing harm to npm install -g ios-deploy ...... therefore I can live with it for now.
So the mystery persisted. I still don't know why /usr/bin/xcrun has to be used instead of CLT/usr/bin/xcrun, I still don't know how in the upgraded case /usr/bin/xcrun managed to locate the correct lib file and didn't throw any warning. What's the difference between the new installation and upgrade?
This answer is just providing a workaround to continue without recreating everything on the machine.
Additional information:
As shown in comments, afterwards I found ios-sim is not working, always crash with exception, thus I had to reinstall OS and started over. The issue disappeared. Now the only difference I can remember, is I installed mac ports in between of OS and xcode during last time.
My recommendation would be, install Xcode right after the OS to avoid unexpected system changes.

Forced to install GDAL 1.11 framework by package for QGIS, and failing

To install QGIS on my MacBook Pro I need to install the gdal framework; however, the 1.11 framework package needed for QGIS is an empty file at kyngchaos. I tried installing GDAL 1.10 complete, but QGIS is requiring 1.11. I have Mavericks. I've installed each individual package: UnixImageIO, PROJ, GEOS, SQLite2, numpy, rgdal, and on... Now when I run the GDAL 1.11 framework install, everything seems to run until the last page, where an "Install Fail" page shows up. When I try to view the error, I'm taken out of the installer.
After some googling, I tried installing using homebrew. (brew install gdal)... I got a little further, but it tells me to "brew link libpng libtiff" -- and when I run that command, I get:
Linking /usr/local/Cellar/libpng/1.5.14... Warning: Could not link libpng. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/libpng/1.5.14/share/man/man3/libpngpf.3
/usr/local/share/man/man3 is not writable. You should change its permissions.
After some more searching, it seems I could change permissions from usr/local to me, but I'm not sure how to (exactly) and don't want to mess anything up. Any help would be greatly appreciated, and my apologies if I'm missing something painfully obvious! I'm a novice at the programming end of things, so am just kind of pushing through everything like a bull in a china shop.
UPDATE:
Okay, I found the answer, even though it didn't seem to be working initially--
I ran the following commands from the GDAL help documentation:
export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH
sudo ln -sfh [ver] /Library/Frameworks/GDAL.framework/Versions/Current
in Terminal, and the framework was updated. If I run the GDAL 1.11 installer it still shows up as a failed installation, BUT QGIS recognizes 1.11 as the installed, so that's great.
(I just needed to install matplotlib in addition, and QGIS was installed successfully.)
It seems that the GDAL Complete framework was just updated 3 days ago, so it should be a temporary error until they realize the package is empty.