UltraNest icon indicating copy to clipboard operation
UltraNest copied to clipboard

Installation Errors

Open Jammy2211 opened this issue 3 years ago • 4 comments

  • UltraNest version: 3.2.0
  • Python version: 3.6 / 3.8
  • Operating System: Linux / Windows subsystem for Linux

Description

Installing ultranest on my laptop (WSL enviroment) and on our supercomputer (LinuxOS), both using a virtual enviroment and NOT conda.

NOTE: Everything works fine in my Windows conda enviroment (which already had Cython installed).

What I Did

pip install ultranest==3.2.0

Collecting ultranest==3.2.0
  Downloading https://files.pythonhosted.org/packages/ae/e9/753e53e5ab71e67f363cb493b54d02d4ea623a3419f8b63962afd15a50e1/ultranest-3.2.0.tar.gz (21.4MB)
    100% |################################| 21.4MB 47kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-i_rq5u6o/ultranest/setup.py", line 9, in <module>
        from Cython.Build import cythonize
    ModuleNotFoundError: No module named 'Cython'

I figure this is due to a missing requirement in the release.

However, even if I install cython manually via pip install cython I then get the following error:

(PyAuto) [dc-nigh1@login5b PyAutoFit]$ pip install cython
Collecting cython
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/16/9a/2eece92da53d954cc5ede815f9825b8ec795252471d0772ff9a591166c98/Cython-0.29.23-cp36-cp36m-manylinux1_x86_64.whl (2.0MB)
    100% |################################| 2.0MB 457kB/s
Installing collected packages: cython
Successfully installed cython-0.29.23
You are using pip version 9.0.3, however version 21.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(PyAuto) [dc-nigh1@login5b PyAutoFit]$ pip install ultranest==3.2.0
Collecting ultranest==3.2.0
  Using cached https://files.pythonhosted.org/packages/ae/e9/753e53e5ab71e67f363cb493b54d02d4ea623a3419f8b63962afd15a50e1/ultranest-3.2.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ml119ibv/ultranest/setup.py", line 22, in <module>
        readme = readme_file.read()
      File "/cosma/local/Python/3.6.5/lib/python3.6/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 773: ordinal not in range(128)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ml119ibv/ultranest/
You are using pip version 9.0.3, however version 21.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

🤷

Jammy2211 avatar May 01 '21 12:05 Jammy2211

Which Linux is this (cat /etc/*release*)?

Yes, unfortunately you need to install cython first, otherwise pip is confused. Probably I should put a warning or error message into the setup.py script.

JohannesBuchner avatar May 03 '21 08:05 JohannesBuchner

My suspicion is that "pip" runs python2, and you need to run pip3 instead. This is at least the case on Ubuntu Linux.

JohannesBuchner avatar May 03 '21 08:05 JohannesBuchner

This could also be partially solved by using pyproject.toml I guess.

See: https://github.com/JohannesBuchner/UltraNest/issues/26

MuellerSeb avatar Jun 06 '21 19:06 MuellerSeb

@MuellerSeb @Jammy2211 A quick and dirty solution is to comment out that read line

Edit these lines in setup.py


try:
    with open('README.rst') as readme_file:
        readme = readme_file.read()
except:
    readme = "hello world"

try:
    with open('HISTORY.rst') as history_file:
        history = history_file.read()
except:
    history = "hello history"

pearsonkyle avatar Dec 06 '21 23:12 pearsonkyle

The project has a project.toml now, please reopen if this is still an issue.

It seems the error comes from the README not being in ascii, and the python default reader expecting ascii on WSL (why on Earth?).

conda should also be an alternative install path.

JohannesBuchner avatar Sep 08 '22 18:09 JohannesBuchner