I am trying to install the Xgboost library.
The problem is that I am on a virtual machine behind a firewall i don't have access to (company computer). I have the Xgboost library that I downloaded from github.
Then I tried to add the path manually to through the Pycharm project interpreter, therefor i don't have any import error detected, the auto completion is even working but when I try to run the code I have this error :
Traceback (most recent call last):
File "C:/Users/UT2BUP/PycharmProjects/AccountingAdjustment/Run/Execution.py", line 1, in
from Run.Main import Main
File "C:\Users\UT2BUP\PycharmProjects\AccountingAdjustment\Run\Main.py", line 22, in
import Modeling.SkLearnHelper as Sk
File "C:\Users\UT2BUP\PycharmProjects\AccountingAdjustment\Modeling\SkLearnHelper.py", line 35, in
import Modeling.Stacking as Stk
File "C:\Users\UT2BUP\PycharmProjects\AccountingAdjustment\Modeling\Stacking.py", line 6, in
import xgboost as xg
File "C:\Users\UT2BUP\Downloads\xgboost-master\python-package\xgboost__init__.py", line 11, in
from .core import DMatrix, Booster
File "C:\Users\UT2BUP\Downloads\xgboost-master\python-package\xgboost\core.py", line 112, in
_LIB = _load_lib()
File "C:\Users\UT2BUP\Downloads\xgboost-master\python-package\xgboost\core.py", line 103, in _load_lib
lib_path = find_lib_path()
File "C:\Users\UT2BUP\Downloads\xgboost-master\python-package\xgboost\libpath.py", line 46, in find_lib_path
'List of candidates:\n' + ('\n'.join(dll_path)))
xgboost.libpath.XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path?
List of candidates:
C:\Users\UT2BUP\Downloads\xgboost-master\python-package\xgboost\libxgboost.dll
C:\Users\UT2BUP\Downloads\xgboost-master\python-package\xgboost../../lib/libxgboost.dll
C:\Users\UT2BUP\Downloads\xgboost-master\python-package\xgboost./lib/libxgboost.dll
C:\ProgramData\Anaconda3\xgboost\libxgboost.dll
C:\Users\UT2BUP\Downloads\xgboost-master\python-package\xgboost../../windows/x64/Release/libxgboost.dll
C:\Users\UT2BUP\Downloads\xgboost-master\python-package\xgboost./windows/x64/Release/libxgboost.dll
So I tried to install with PIP in local but when I do
python pip install C:\Users\UT2BUP\Downloads\xgboost-master\python-package
I got the same error as above (2nd part only).
Any ideas ?
The most straightforward way is to download the xgboost wheel and install using pip.
pip install xgboost‑0.6‑cp36‑cp36m‑win_amd64.whl
The other option is what you are trying to do now. To build from source, you have to make sure your compiler is set up. For instructions on that, I suggest you start on the Windows Compilers page, then visit the docs for compiling xgboost.
Related
I installed the last version of Miniconda and created a new environment.
I have pip installed the following repos:
pip install git+https://git.ufz.de/FINAM/finam.git
pip install git+https://git.ufz.de/FINAM/finam-netcdf.git
pip install git+https://git.ufz.de/FINAM/finam-plot.git
pip install git+https://git.ufz.de/FINAM/finam-graph.git
Finally, I cloned this repo
git clone https://git.ufz.de/FINAM/finam-examples.git
In that repo I ran two files component.py and pet_calculator.py located at:
~/finam-examples/01_Hargreaves-Samani/src/
I first ran component.py, and that was ok.
The problem came when I ran pet_calculator.py.
This is my error:
(test) sh-3.2$ /Users/lealroja/miniconda3/envs/test/bin/python /Users/lealroja/Documents/UFZ/finam_project/finam-examples/01_Hargreaves-Samani/src/pet_calculator.py
2023-02-19 23:09:44,109 INFO: init composition - FINAM
Traceback (most recent call last):
File "/Users/lealroja/Documents/UFZ/finam_project/finam-examples/01_Hargreaves-Samani/src/pet_calculator.py", line 49, in <module>
composition.initialize()
File "/Users/lealroja/miniconda3/envs/test/lib/python3.11/site-packages/finam/schedule.py", line 148, in initialize
mod.initialize()
File "/Users/lealroja/miniconda3/envs/test/lib/python3.11/site-packages/finam/sdk/component.py", line 65, in initialize
self._initialize()
File "/Users/lealroja/miniconda3/envs/test/lib/python3.11/site-packages/finam_netcdf/reader.py", line 191, in _initialize
self.dataset = xr.open_dataset(self.path)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lealroja/miniconda3/envs/test/lib/python3.11/site-packages/xarray/backends/api.py", line 510, in open_dataset
engine = plugins.guess_engine(filename_or_obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lealroja/miniconda3/envs/test/lib/python3.11/site-packages/xarray/backends/plugins.py", line 177, in guess_engine
raise ValueError(error_msg)
ValueError: did not find a match in any of xarray's currently installed IO backends ['netcdf4', 'scipy']. Consider explicitly selecting one of the installed engines via the ``engine`` parameter, or installing additional IO dependencies, see:
https://docs.xarray.dev/en/stable/getting-started-guide/installing.html
https://docs.xarray.dev/en/stable/user-guide/io.html
I have that error when using a Mac book Pro. However, when I do the exact same procedure and run it in Ubuntu I have no issues.
I am not an expert, and therefore I have no idea what to do. Could you please help me?
I have tried answers from this links:
IO backend error in the xarray for netcdf file
ValueError: found the following matches with the input file in xarray's IO backends: ['netcdf4', 'h5netcdf']
Thank you in advance.
I am attempting to build a speech-to-text algorithm using Mozilla DeepSpeech, but I am having trouble installing the package.
First, I created a new virtual environment in Anaconda called deepspeech-venv and installed the latest version of the deepspeech package (v0.8.1) via pip in the Anaconda Powershell with the command pip install deepspeech --upgrade.
Next, I downloaded both the pbmm version and the tflite version of the pre-trained English models from Mozilla's GitHub using the commands wget https://github.com/mozilla/DeepSpeech/releases/download/v0.8.1/deepspeech-0.8.1-models.pbmm and wget https://github.com/mozilla/DeepSpeech/releases/download/v0.8.1/deepspeech-0.8.1-models.tflite.
Finally, I wanted to check and make sure that everything installed correctly, so I typed deepspeech -h into the command line, which produced the following error statement:
Traceback (most recent call last):
File "c:\users\zachary.holden\anaconda3\envs\deepspeech_venv\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\zachary.holden\anaconda3\envs\deepspeech_venv\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\zachary.holden\Anaconda3\envs\deepspeech_venv\Scripts\deepspeech.exe\__main__.py", line 4, in <module>
File "c:\users\zachary.holden\anaconda3\envs\deepspeech_venv\lib\site-packages\deepspeech\__init__.py", line 23, in <module>
from deepspeech.impl import Version as version
File "c:\users\zachary.holden\anaconda3\envs\deepspeech_venv\lib\site-packages\deepspeech\impl.py", line 13, in <module>
from . import _impl
ImportError: DLL load failed: The specified module could not be found.
From what I understand, this means that I'm lacking some dependencies for the deepspeech library; however, I'm not quite sure what additional DLLs need to be installed or even how to go about that process. (Unless, of course, if the issue lies in my installation process, and I merely have to add another library.)
NOTE: I am running Python v3.7.7 on a Windows 10 64-bit system.
I copied the "libdeepspeech.so" file from "lib" directory to directly under "deepspeech" directory as suggested in the below shared link and it worked for me.
Reference Link
I installed canopy from the .sh file provided from the link of the Enthought canopy site and then ran the following command after cd into the Canopy directory.
Ashish#LoneWarrior Canopy]$ ./canopy
Subprocess output:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/Ashish/Canopy/appdata/canopy-2.1.3.3542.rh6-x86_64 /lib/python2.7/site-packages/pyface/gui.py", line 20, in <module>
from .toolkit import toolkit_object
File "/home/Ashish/Canopy/appdata/canopy-2.1.3.3542.rh6-x86_64/lib/python2.7/site-packages/pyface/toolkit.py", line 99, in <module>
_init_toolkit()
File "/home/Ashish/Canopy/appdata/canopy-2.1.3.3542.rh6-x86_64/lib/python2.7/site-packages/pyface/toolkit.py", line 65, in _init_toolkit
be = import_toolkit(ETSConfig.toolkit)
File "/home/Ashish/Canopy/appdata/canopy-2.1.3.3542.rh6-x86_64/lib/python2.7/site-packages/pyface/toolkit.py", line 58, in import_toolkit
__import__(be + 'init')
File "/home/Ashish/Canopy/appdata/canopy-2.1.3.3542.rh6-x86_64/lib/python2.7/site-packages/pyface/ui/qt4/init.py", line 18, in <module>
from pyface.qt import QtCore, QtGui, qt_api
File "/home/Ashish/Canopy/appdata/canopy-2.1.3.3542.rh6-x86_64/lib/python2.7/site-packages/pyface/qt/QtGui.py", line 8, in <module>
from PySide.QtGui import *
This is the main error : ZLIB_1.2.9 not found.
ImportError: /home/Ashish/Canopy/appdata/canopy-2.1.3.3542.rh6-x86_64/bin/../lib/libz.so.1: version `ZLIB_1.2.9' not found (required by /lib64/libpng16.so.16)
I have tried changing the python default to 3 but still it is not working.
I presume the problem is on an Arch-based distribution. The temporary solution in this case is to downgrade libpng to 1.6.28 (this worked in my case). If you don't have it in your cache (`/var/cache/pacman/pkg'), you can download it from https://archive.archlinux.org/packages/l/libpng/
Then, following https://wiki.archlinux.org/index.php/downgrading_packages run in the directory with the downloaded file
# pacman -U libpng-1.6.28-1-x86_64.pkg.tar.xz
(with the correct architecture, of course)
Don't forget to list libpng in /etc/pacman.conf among ignored packages to prevent upgrading. Look for the [options] section and add IgnorePkg = libpng.
Improtant. Keep in mind that downgrading packages is not harmless, therefore, this is only a temporary solution.
The problem is that the libz file in the canopy environment is not compatible with the ZLIB installed in your system.
For a quick fix: just copy the libz.so.1 file from lib directory to your canopy environment.
In my case it was
$ cp /usr/lib/libz.so.1 path-to-Canopy-install-directory/appdata/canopy-2.1.6.3665.rh6-x86_64/lib/libz.so.1
My issue is possibly similar to link
but thought I'd ask jic. I'm on osx and trying to use jedi-vim. I installed jedi using pip and then jedi-vim by cloning into the dir that my vim config uses for loading packages. this one for reference. When I start vim with a python program I get the "Please install Jedi if..." message. I cloned vim 74 and configured with +python and +conceal. After still getting the error I looked into the code and found it was an import error.
As an aside, this isn't the best help message. Better might be "Unable to import jedi. Have you installed Jedi?"
I tried import jedi from within vim, as :python import jedi
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/jedi-0.9.0- py2.7.egg/jedi/__init__.py", line 41, in <module>
from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
File "/usr/local/lib/python2.7/site-packages/jedi-0.9.0 py2.7.egg/jedi/api/__init__.py", line 16, in <module>
from jedi.parser import Parser, load_grammar
File "/usr/local/lib/python2.7/site-packages/jedi-0.9.0-py2.7.egg/jedi/parser/__init__.py", line 21, in <module>
from jedi.parser import tree as pt
ImportError: cannot import name tree
If this is a build issue, is there a good reference for building vim on mac?
I had to ask this again, because a related question solves the problem when there is no virtualenv involved.
Now I have more than one virtualenv that I would like to package in executables using cx_Freeze. I run my cx_Freeze setup file normally using virtualenv python interpreter, but then when I try to execute my program, pytz doesn't find the files, probably because if you see the error below, it is searching them in the original directory of virtualenv where they were located. I checked the time zone files are located correctly into the zip file.
This is the error message I get when trying to run my bundled program:
cserpell#e431:~/src/build/exe.linux-x86_64-2.7$ ./validate
/home/cserpell/src/build/exe.linux-x86_64-2.7/library.zip/distutils/__init__.py:14: UserWarning: The virtualenv distutils package at %s appears to be in the same location as the system distutils?
Traceback (most recent call last):
File "/home/cserpell/src/virtualenvtest/local/lib/python2.7/site-packages/cx_Freeze/initscripts/Console.py", line 27, in <module>
exec(code, m.__dict__)
File "scripts/validate.py", line 9, in <module>
File "/home/cserpell/src/scripts/script.py", line 15, in <module>
from common import time_util
File "/home/cserpell/src/common/time_util.py", line 31, in <module>
SCL_TZ = pytz.timezone('America/Santiago')
File "/home/cserpell/src/virtualenvtest/local/lib/python2.7/site-packages/pytz/__init__.py", line 180, in timezone
raise UnknownTimeZoneError(zone)
pytz.exceptions.UnknownTimeZoneError: 'America/Santiago'
I found the answer myself. The only thing needed was to install setuptools in my virtualenv. For the record, it is very strange that I installed it using pip in the virtualenv, but then when I run pip list or pip freeze, it doesn't show setuptools as requirement, though it is for the cx freeze script.