How to get mpfr package on Spyder (python 3.9) win64 - python

I need bigfloat package to work for my program. When I downloaded and put it into the correct folder, the console now says this when I try to start the program:
ModuleNotFoundError: No module named 'mpfr'
I tried downloading this module, however, I cannot get Spyder to see it, and the INSTALL file, which is in the folders I downloaded, only specifies a way to install mpfr on Linux.
I also tried to install this module through the Spyder kernel component, and this simply said:
pip install mpfr
Note: you may need to restart the kernel to use updated packages.
ERROR: Could not find a version that satisfies the requirement mpfr (from versions: none)
ERROR: No matching distribution found for mpfr
When I attempted to download mpfr from conda forge, it said everything was done, and threw no errors, this however did not solve my problem.
I also found that mpfr needs GNU to work, but I found that only in .lz file and the internet tells me that cannot be unzipped on windows. I however did not encounter any errors regarding this, as I did not get that far. May be irrelevant.
I use Spyder 5.3.3 with Anaconda3.
I have Windows 11 Home.

Related

Can't find Brew installed packages on Mac M1 in Pycharm

I'm having trouble installing packages and using them in Pycharm. I've followed various threads (I'm new to Macs and seem to have tried everything) now I'm stuck.
In this case, I want to use the package xgboost.
I have brew installed, after launching a terminal using Rosetta:
%brew install xgboost
Warning: xgboost 1.3.3 is already installed and up-to-date.
It appears installed OK here:
/opt/homebrew/Cellar/xgboost
I also have Python installed here:
/opt/homebrew/Cellar/python#3.9
But no matter how I configure an Interpreter in Pycharm, I can't seem to get the package recognised.
Where have I gone wrong?
I am very unsure exactly how, but I've got this working.
Following: https://abbasegbeyemi.me/blog/homebrew-python-apple-m1
I changed the order of elements in my path:
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin
then a new interpreter in Pycharm using:
usr/local/Cellar/Python#3.9/3.9.2_2/bin/python3.9
Now I can install packages just using pip in pycharm and it works.
This has been 6 hours of pain - warning to anyone who isn't well versed in macs, setting up an M1 for python dev was a complete nightmare for me.
Docs: https://xgboost.readthedocs.io/en/latest/build.html
Pre-built binary wheel for Python
If you are planning to use Python, consider installing XGBoost from a pre-built binary wheel, available from Python Package Index (PyPI). You may download and install it by running
# Ensure that you are downloading one of the following:
# * xgboost-{version}-py2.py3-none-manylinux1_x86_64.whl
# * xgboost-{version}-py2.py3-none-win_amd64.whl
pip3 install xgboost

can't install pptk in python

I'm trying to install the pptk module in PyCharm for visualising 3D point clouds.
Initially I tried installing in PyCharm via File > Settings > Python Interpreter > Install > pptk
However, it couldn't be found and advised I use pip instead.
So on my command prompt I navigated to the folder containing Python 3.9 and tried pip install pptk
And I got the following error ERROR: Could not find a version that satisfies the requirement pptk (from versions: none) ERROR: No matching distribution found for pptk
I'm not sure what I'm doing wrong or why no version can be found? Am I missing something obvious in the installation?
According to the requirements by the pptk module, the minimum Python version required is 3.6. Judging by the fact that there's no distribution found for 3.9 I believe that it was missing a PyPi repo for it, therefore downgrading to Python 3.6 should fix the problem. Judging by your response to my comment, that did work.

Need help installing fiona and geopandas for python in Windows 10 - getting can't load requested DLL error

I am trying to install fiona and geopandas for python on Windows 10 and keep running into an error "ERROR 1: Can't load requested DLL".
I know this question is similar to other questions that have been asked, but I have followed the steps in multiple answers and tutorials and still can't seem to get this to work.
The closest I got was using the steps outlined in this tutorial : https://geoffboeing.com/2014/09/using-geopandas-windows/
and are summarized as follows:
installed the .whl files for rtree, pyproj, shapely, gdal, geopandas, fiona from https://www.lfd.uci.edu/~gohlke/pythonlibs/
Rtree-0.8.3-cp37-cp37m-win_amd64.whl
pyproj-2.2.1-cp37-cp37m-win_amd64.whl
GDAL-3.0.0-cp37-cp37m-win_amd64.whl
geopandas-0.5.0-py2.py3-none-any.whl
Fiona-1.8.6-cp37-cp37m-win_amd64.whl
Shapely-1.6.4.post2-cp37-cp37m-win_amd64.whl
navigated to download folder and used pip install to install GDAL wheel
added the osgeo path to my windows user Path environment variable
used pip install to install remaining wheels (geopandas last), everything installed without errors
As a check, I ran gdalinfo --help-general and get the following output:
This is where I get the "ERROR 1: Can't load requested DLL:" error. It says it cannot find the specified module "ogr_FileGDB.dll". The weird thing is, that .dll is actually in the location that it is looking in???
Also, in python shell, when trying to import fiona or geopandas I get the following errors:
This is beyond my level of troubleshooting...would really appreciate if anyone could get this thing working for me!!!!
FYI - running Python 3.7.3, Windows 10, pip is updated.
Lastly and potentially important (not sure how it plays in?) I already have a GDAL_DATA system variable defined, and also (maybe incorrectly?) also tried adding the osgeo path to my system path variable:
I was using a GDAL version that was not compatible with Fiona and subsequently causing issues with geopandas.
I uninstalled GDAL 3 and installed GDAL 2.4.1 and it worked fine, as cgohlke suggested.
Install fiona with conda, then that will solve the GDAL problem. pip install geopandas should work after that.

Anaconda "import georaster" error: specified module not found

I am using Anaconda3 5.2.0 for Windows 10 64 bit, which is python 3.6.5 (Anaconda3-5.2.0-Windows-x86_64.exe). I have installed this into C:\Anaconda3 and then from the anaconda prompt installed basemap:
conda install -c conda-forge basemap
conda install -c conda-forge basemap-data-files
I have used this to start building map files and everything is working fine. I then wanted to add a raster to the map using georaster.
conda install -c conda-forge georaster
This also installs gdal.
When I open Jupyter Notebook and enter the line
import georaster
I get the following error message:
ImportError: DLL load failed: The specified module could not be found.
I have tried various solutions that I have seen for related issues including installing a gdal update, fiona, and geopandas. None of these change the message.
I tried installing gdal using the binaries .whl file in conda, but despite following the advice (which said to use pip) I was not able to make it work.
pip install GDAL-2.2.4-cp37-cp37m-win_amd64.whl
resulted in an error message:
GDAL-2.2.4-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
Finally I went looking to see if I could locate the missing DLL manually. I saw one user suggest libtiff.dll was the missing file, and indeed it was one I did not have. I downloaded it and copied it into the System32 and SysWOW64 folders. This still resulted in an error but changed the error message:
ImportError: DLL load failed: %1 is not a valid Win32 application.
However I could not find a way to stop the error from occurring. I followed the steps to register the .dll but that also had an error message from not found to not supported:
(cmd prompt in administrator mode)
regsvr32.exe /i libtiff.dll
The module "libtiff.dll" failed to load.
Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.
The specified module could not be found.
I have tried downloading from 2 other websites, neither with any success. It is feeling like every method I attempt now just hits some weird error that nobody else is seeming to have and I don't understand why.
If anyone could offer some advice I'd be very appreciative. Thank you in advance.
downloading the required *.whl file(GDAL-2.2.4-cp36-cp36m-win_amd64.whl) from https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal and then copying it to a location like C:\GDAL-2.2.4-cp36-cp36m-win_amd64.whl
then pip install c:\GDAL-2.2.4-cp36-cp36m-win_amd64.whl
worked for me.
Thanks.

Could not import cufflinks

Problem
I am trying to install both plotly and cufflinks. However I had a problem.
The installation of both plotly and cufflinks were successful. Although, I can't import cufflinks.
Below is a picture of the problem. It seems to be a dependency error:
I tried manually downloading and installing "talib" but I keep getting failures. (Shown below).
talib\common.c(240): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
Any Ideas? I tried re-installing both modules and Anaconda. Nothing So far.
Other infos:
Cufflinks version: 0.11.0
Plotly version: 2.0.10
Anaconda version: 3-4.4.0 (But I don't think it have anything to do with it)
Python version: 3.6.1
try installing this version of cufflinks, it eliminated the error for me.
pip install cufflinks==0.8.2
From this link: github.com/mrjbq7/ta-lib#troubleshooting
Troubleshooting
Sometimes installation will produce build errors like this:
func.c:256:28: fatal error: ta-lib/ta_libc.h: No such file or directory
compilation terminated.
This typically means that it can't find the underlying TA-Lib library, a dependency which needs to be installed. On Windows, this could be caused by installing the 32-bit binary distribution of the underlying TA-Lib library, but trying to use it with 64-bit Python.
Windows
Download ta-lib-0.4.0-msvc.zip and unzip to C:\ta-lib
This is a 32-bit release. If you want to use 64-bit Python, you will need to build a 64-bit version of the library.
My Fix
So, for windows, we need a 64-bit version of the library? Luckly I found a lot of modules built for 32 and 64 bits python:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
search for "ta-lib" and click on the module you need (In my case cp36 64 bits).
Then, open the command prompt.
Change to where you downloaded the file: cd path/to/file
Type: pip install NameOfFile (in my case pip install TA_Lib‑0.4.10‑cp36‑cp36m‑win_amd64.whl )
Now the 64-bits Ta-Lib module should be installed in your machine. I tested the previous line of codes and it worked!
Thanks for the help :)
I have now removed all dependencies on talib. All studies are pure python based now and you should not face any of this errors.

Categories