-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fresh yt installation not importing #2892
Comments
Hi! One reason this often happens is if it isn't built. But, pip
installing it like this should build. Can you provide the full log output
from the pip install?
…On Fri, Sep 4, 2020 at 10:32 AM Raziq Noorali ***@***.***> wrote:
Bug report
*Bug summary*
yt fails to import on a fresh development installation. The error is that ModuleNotFoundError:
No module named 'yt.utilities.lib.misc_utilities'
*Code for reproduction*
Installed using pip install git+git://github.com/yt-project/yt.git
# Paste your code here##import yt
*Actual outcome*
# If applicable, paste the console output here
#
#
*Expected outcome*
*Version Information*
- Operating System: CentOS Linux 7 (Core)x86_64
- Python Version: 3.8.5
- yt version: 4.0.dev0
- Other Libraries (if applicable): N/A
Installed using pip install git+git://github.com/yt-project/yt.git
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2892>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAVXO7JCM3FCUAY7FJ3CGTSEECCRANCNFSM4QYVEXEQ>
.
|
Hi @matthewturk. I apologize for the delay. In solidarity with the graduate student strike at the University of Michigan, I have not crossed imposed picket lines and am getting to this now. Please let me know if you need anything else! log from pip install:
|
What is the output of the following two commands?
Also, it may prove useful to provide the log using |
Sure!
The verbose log is quite long, soft the sake of readability I attached it here |
Alright, this looks definitely like a bug on yt's side: yt relies on some files that need to be compiled (for higher efficiency). However, for some reason they do not get compiled when one installs using the command you tried (I can reproduce this on my side). In the meantime, you should be able to install with the following commands: $ cd /path/to/where/yt/will/be
$ git clone https://github.com/yt-project/yt.git
$ cd yt
$ pip install -e . |
So after some debugging, it turns out that yt cannot be installed unless pip install -e git+https://github.com/yt-project/yt.git#egg=yt # works
pip install git+https://github.com/yt-project/yt.git#egg=yt # does not compile the cython files This stems from the fact that |
Hi @Provider10 , would it be possible to try out the bugfix I submitted and tell me if this works for you?
|
Hi @cphyc. The above command gave the following output:
Since I see the above was merged I also checked the current master branch (4d9ab24) and got a new error when I try to import yt:
I'd like to recommend that this issue be reopened |
That is embarrassing. Can you confirm that if you clone the yt repository and install via |
Lol sorry about that! When installing as in your above suggestion, I get the following error message (send via text log to save space). Thanks for taking the time to go through this with me! I really appreciate it |
The pip command you should try |
Ah, my apologies for sending you a novel-length log then. I'm afraid I'm not versed enough in yt to be able to attempt a bigfix, but please let me know how I can help! |
Hello! I get this error too after a fresh installation of the most recent master branch of yt, and when I try to import yt. pip version : pip 20.2.3 When i git cloned yt, and checkout out I get the following error
Please let me know if there is any other detail that may help to fix this or if there is something that I can fix in my python environment setup. |
Just a note as @RevathiJambunathan is encountering the same issue as the OP and we debugged it together offline a bit. I would focus on the issue with
# cleaning up
python3 -m pip uninstall yt
# upgrading important basics
python3 -m pip install -U pip setuptools wheel
python3 -m pip install -U cython
# this is our life now
python3 -m pip wheel .
python3 -m pip install *whl (apply
|
upon "grepping" for error I get 👍 the gcc version is - gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609 |
It looks like the GCC 5.4.0 compiler does not recognize the compiled files as C++11 in those setups: yt/yt/utilities/lib/ewahboolarray/ewah.h Lines 626 to 628 in 8859747
This might not occur in CI or on newer systems, because GCC 6+ default to C++14: https://gist.github.com/ax3l/53db9fa8a4f4c21ecc5c4100c0d93c94 Checking the history of that file, it looks like #2575 introduced this with an update of EWAHBoolArray, which defaults to C++11 in newer versions. The solution would probably be to add I can reproduce this on newer Ubuntu's by running: export CC=$(which gcc-5)
export CXX=$(which g++-5)
python3 -m pip wheel -v . A related challenge/bug in this issue: this is clearly an error in the build process. A build error of a component/extension should abort the whole installation, instead of silently installing an incomplete version of |
Proposed bug fix for compiler compatibility: #2939
I have no idea how to fix this aspect. |
Try the following: diff --git a/setupext.py b/setupext.py
index 6b20f8b..4a505a8 100644
--- a/setupext.py
+++ b/setupext.py
@@ -6,7 +6,7 @@ import shutil
import subprocess
import sys
import tempfile
-from concurrent.futures import ThreadPoolExecutor as Pool
+from concurrent.futures import ThreadPoolExecutor
from distutils import log
from distutils.ccompiler import CCompiler, new_compiler
from distutils.errors import CompileError, LinkError
@@ -354,11 +354,23 @@ def create_build_ext(lib_exts, cythonize_aliases):
ncpus = get_cpu_count()
if ncpus > 0:
- with Pool(ncpus) as pool:
- pool.map(self.build_extension, self.extensions)
+ with ThreadPoolExecutor(ncpus) as executor:
+ results = {
+ executor.submit(self.build_extension, extension): extension
+ for extension in self.extensions
+ }
+ for result in results:
+ result.result()
else:
super().build_extensions()
+ def build_extension(self, extension):
+ try:
+ super().build_extension(extension)
+ except CompileError as exc:
+ print(f"While building '{extension.name}' following error was raised:\n {exc}")
+ raise
+
class sdist(_sdist):
# subclass setuptools source distribution builder to ensure cython
# generated C files are included in source distribution. Now the main process should die if any child thread died. |
@Xarthisius revisiting you suggestion, should this patch still go into mainline? :) |
Bug report
Bug summary
yt fails to import on a fresh development installation. The error is that
ModuleNotFoundError: No module named 'yt.utilities.lib.misc_utilities'
Similar to Issue 2685Code for reproduction
Installed using
pip install git+git://github.com/yt-project/yt.git
Actual outcome
Expected outcome
Version Information
Installed using
pip install git+git://github.com/yt-project/yt.git
Thanks!
The text was updated successfully, but these errors were encountered: