Skip to content
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

Error while compiling the Python code with Tensorflow with Nuitka compiler #74

Closed
swatinair123 opened this issue Apr 16, 2018 · 12 comments

Comments

@swatinair123
Copy link

swatinair123 commented Apr 16, 2018

Hi,

I am trying to compile a very simple code with tensorflow. which imports tensorflow. The code compiles fine with Pycharm. But when i try comiling with nuitka --recurse-all Tensorflow_test.py . I have installed Nuitka using anaconda prompt
It gives warning Nuitka:WARNING:Tensorflow_test.py:1: Cannot find 'tensorflow' as relative or absolute import.

I tried nuitka --recurse-all --recurse-directory=C:\Users\tier3dlab1\Anaconda2\pkgs\tensorflow-1.2.1-py36_0\Lib\site-packages\tensorflow --show-progress --standalone Tensorflow_test.py this command also where i am giving the path of tensorflow .But it gives me the below error
File "c:\users\tier3dlab1\anaconda2\lib\site-packages\nuitka\nodes\ModuleNodes.py", line 57, in init
assert '.' not in name, name
AssertionError: benchmark.xcodeproj
and with lots of warnings.
I am able to compile a simple python code with Nuitka. The screenshots are as attached.Please advise
img1
imag2

@kayhayen
Copy link
Member

Do not use --recurse-directory that way, although it ought to work, but it requires that you do really get right what you are using. However, I can see from the traceback and your PATH that it ought to work.

Can you try calling Nuitka with "python -m nuitka" invocation from your Anaconda Python environment to make sure it isn't that.

I am assuming now there is a ".pth" file that gets in the way of things, or something like this. I will try and reproduce with current Anaconda. Unfortunately you gave no versions for Nuitka, nor Anaconda there. I assume the one included?

@kayhayen
Copy link
Member

As for advice to not use recurse directory, next release has "--include-package" that does work on package names.

@kayhayen
Copy link
Member

kayhayen commented Apr 18, 2018

Trying to reproduce this on an albeit older Anaconda2:

~/anaconda2/bin/python Mini.py Traceback (most recent call last):
File "Mini.py", line 1, in
import tensorflow
ImportError: No module named tensorflow

@kayhayen
Copy link
Member

Ok, my Anaconda skills are too low. I need to do a conda install tensorflow it seems.

@kayhayen
Copy link
Member

Well, recursing all of tensorflow clearly isn't possible, it includes "contrib" which is just massive amounts of code. I did however not get the assertion from the import code you did. I believe it may be an indication of you using an older Nuitka version. Please use latest by updating with "conda update nuitka" or so.

@pratikshaandhare
Copy link

pratikshaandhare commented Apr 20, 2018

Hi,

I am compiling the tensorflow code with Nuitka(version 0.5.28) with help of anaconda by using command "nuitka --recurse-all predict.py". I am using Python 3.5/3.6. The simple tensorflow code of printing something is working fine on Nuitka by above command. But when I compile some classification tensorflow code with Nuitka , I am getting the warning/error "scons: *** [predict.exe] the filename or extension is too long in nuitka" where the filename(predict.py) is short. I am saving .exe file into same folder of the code and .exe file is not generating.

Here is the screenshot of anaconda prompt. Can you please help me out?

Thanks and regards,
Pratiksha

nuitkaerror

@kayhayen
Copy link
Member

@pratikshaandhare This seems to be a Windows, scons, or compiler issue that I have no clue about.

If I had predict.py I would give it a shot here and see if it happens for me too. Have you tried to have ASCII filenames for the directory you compile in? That is about it.

@kayhayen
Copy link
Member

@swatinair123 No feedback?

@kayhayen
Copy link
Member

Lack and feedback, plus stink of old bug, closing this.

@cooperdk
Copy link

cooperdk commented Jul 31, 2018

It's not an old bug. I am seeing this too right now, current version of Nuitka and Python...
Except it's scons that returns this error, not predict.

@kayhayen
Copy link
Member

@cooperdk There is very little that Nuitka can do about this, needs a Scons improvement or so I am thinking. Please consult them.

@CoderReece
Copy link

Has anyone figured out a work around for this? I'm having this issue when trying to use Nuitka with a discordpy script

@Nuitka Nuitka locked and limited conversation to collaborators Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants