Cython link.exe' failed with exit status 1104 when updating .pyx file - cython

I have created a .pxy file with functions in it and it runs with no problem, I can import it from .py and all with no trouble, however, when I modify it and try to compile it again with the setup.py way, it appears the error in the title. I have tried copying the rc.exe and rcdll.dll files from the Windows Kits to Microsoft Visual and it doesnt work.
Do you have an idea of what is happening?
I have also tried the "import pyximport; pyximport.install()" but it doesnt update the imported .pxy
This is the error:
LINK : fatal error LNK1104: cannot open file 'C:\direction\test_cython.cp37-win_amd64.pyd'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\link.exe' failed with exit status 1104
Thank you!
EDIT
I realize the setup.py thing works when I close spyder, however, i still wonder if there is a way to update the pyd (ie the import file) without having to restart spyder

Related

Pygame auto-py-to-exe gets stuck after selecting script location [duplicate]

I try to install Auto-Py-to-exe but they have a lot of error appear during the installation but at the end it sais successfully installed, see picture below.
I have windows 10pro, PyCharm community 2020.3.3, and i use python 3.9.1 for almost all my projects.
I have uninstall auto-Py-to-exe, piwin, PYpiwin32, pywin32, PyInstaller. Close all the system and reboot, re-install all these module, but nothing seem to work. It the same error when i use Python 3.6 or 3.7. the same error arrived in PyCharm terminal and in the promt(cmd) window terminal.
C:\Windows\system32>auto-py-to-exe
Traceback (most recent call last):
File "c:\users\mélissa\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None, File "c:\users\mélissa\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals) File "C:\Users\Mélissa\AppData\Local\Programs\Python\Python39\Scripts\auto-py-to-exe.exe\__main__.py", line 7, in <module>
File "c:\users\mélissa\appdata\local\programs\python\python39\lib\site-packages\auto_py_to_exe\__main__.py", line 291, in run
if eel.chrome.get_instance_path() is not None and not disable_chrome:AttributeError: module 'eel.chrome' has no attribute 'get_instance_path'
C:\Windows\system32>
I have made the update of PIP, EEL, PYInstaller( the upper version they want to install is 3.2.1, the other fail), gevent and greenlet but i receive always the same error message.
I don't know what to do. I have check here for answer or direction to resolve my problem but i find nothing for now.
the error message in PYCharm, it the same in window terminal
It appears, while looking at the traceback, that the error is in the source code, and not your own execution. Looking through the auto-py-to-exe GitHub repository files, it seems that the package just uses pyinstaller to convert the python script(s) to executable files. In this case, I would recommend just using pyinstaller itself.
To convetr the .py file to a single file, run:
pyinstaller my_script.py --onefile --windowed
The .exe file will appear in a folder dist/ (created during the build). The build/ folder along with other files created during the process can be deleted.

Tesseract 4.1.1 error eng.traineddata not found in google colab

I am trying to install tesseract 4.1.1 in google colab. I have installed tesseract and I can check the version using !tesseract --version. After that I have download eng.traineddata and org.traineddata in the /usr/local/share/tessdata/ folder
Now when trying to use it from python it's giving me the following error
TesseractError: (1, 'Error opening data file /usr/local/share/tessdata/eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language \'eng\' Tesseract couldn\'t load any languages!)
I have tried to check the file exist or not using this
if os.path.isfile('/usr/local/share/tessdata/eng.traineddata'):
print ("File exist")
which prints File exist. Any help regarding that will be appreciated. Thanks
Try this command
export TESSDATA_PREFIX=/usr/local/share/

How to set up a windows cython environment from scratch?

I have been searching on the internet for hours to find out how to make cython work with no success.
I am on windows , i use python3 with Anaconda and i also have Codeblocks using the mingw GCC compiler.
I would like to be able to run even the most basic code (like 'helloworld') with cython because untill now i've only encountered errors i don't understand. They may come from an unstable developping environment so this is why i ask this question.
The main errors happen when translating the .pyx code to .c and even when i achieve that there are even more errors on the .c generated.
here is my 'helloworld.pyx' :
print('Hello Wolrd')
here is my setup.py :
from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules=cythonize('helloworld.pyx'))
when i run python3 setup.py i get ModuleNotFoundError: No module named 'Cython'
when i run cython helloworld.pyx , I get a file helloworld.c
but when i run it in Codeblocks i get the error Python.h : no such file or directory
so i temporary fixed it by puting the absolute path in the include command but i still get errors.
i also tried using python setup.py build_ext --inplace but i get
running build_ext
building 'helloworld' extension
C:\MinGW\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\Julien\anaconda3\include -IC:\Users\Julien\anaconda3\include -c helloworld.c -o build\temp.win-amd64-3.7\Release\helloworld.o
In file included from C:\Users\Julien\anaconda3\include/Python.h:87:0,
from helloworld.c:4:
C:\Users\Julien\anaconda3\include/pytime.h:123:59: warning: 'struct timeval' declared inside parameter list
C:\Users\Julien\anaconda3\include/pytime.h:123:59: warning: its scope is only this definition or declaration, which is probably not what you want
C:\Users\Julien\anaconda3\include/pytime.h:131:5: warning: 'struct timeval' declared inside parameter list
C:\Users\Julien\anaconda3\include/pytime.h:136:5: warning: 'struct timeval' declared inside parameter list
helloworld.c:201:41: warning: division by zero
helloworld.c:201:12: error: enumerator value for '__pyx_check_sizeof_voidp' is not an integer constant
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
I followed tutorials to install mingw (it works for coding in C in codeblocks so I should have installed it properly) and I verified that Cython was correctly installed in Python libraries. What did I do wrong ??
Ok so the problem was effectively in the compilers.
the problem was because my mingw compiler was not correct : i suggest following
these instructions which you will find at https://wiki.python.org/moin/WindowsCompilers.
/!\ do not forget to install setuptools on your python environment (using the command given works for me)
this should at least allow you to make the basic tutorial for cython

CodeLite not starting on fedora 32

I installed CodeLite using the rpm package from their website.
When I tried to open the program for the first time nothing happened.
Trying to start codelite from the console i get the following error message:
codelite: error while loading shared libraries: libSDL-1.2.so.0: cannot open shared object file: No such file or directory
I have installed SDL and SDL to try to solve this problem, but it didn't make a difference. the not found file seems to be at the right place. Im relatively new to Linux so I might forgeting something?
[leon#linux ~]$ ls /usr/lib/libSDL*
/usr/lib/libSDL-1.2.so.0 /usr/lib/libSDL-1.2.so.0.11.4
RPM: codelite-14.0-2.fc32.x86_64
Fedora 32
I really don't know how to continue from here so every help would be appreciated

"Couldn't resolve hostname" while installing package in Octave

I have tried installing a package in Octave using this command:
pkg install signal-1.4.0.taz.gz
but I received the following error:
error: pkg: failed to read package 'signal-1.4.0.taz.gz': Couldn't resolve host name
error: called from
pkg at line 429 column 17
Does somebody know what that means?
You have mis-spelled the name of the package's tarball. It is likely signal-1.4.0.tar.gz rather than signal-1.4.0.taz.gz (Note that one has TAR and the other has TAZ in the extension)
pkg install signal-1.4.0.tar.gz
Essentially what is happening, is that Octave is unable to find the file signal-1.4.0.taz.gz on the file system (due to the mis-spelling) so then it attempts to download the file from the internet. When it tries to resolve signal-1.4.0.taz.gz as a URL, DNS name resolution fails giving you the error that you're encountering.
I just had the same issue/error when trying to install the econometrics package on a windows install. In my case, for reasons unknown I was getting the following error:
>> pkg install econometrics-1.1.1.tar.gz
error: pkg: failed to read package 'econometrics-1.1.1.tar.gz': Couldn't resolve host name
error: called from
pkg at line 433 column 17
The only way I managed to get it, was by first downloading the package manually into the current working directory of Octave. (See pwd output.) Only then did the install command work.
pkg install econometrics-1.1.1.tar.gz
pkg load econometrics
I recently have this problem, you need to place the file in the Octave directory and from there rigth clik on the file to copy to clipboard and then paste from there.
example:
to me work to change the document to disc D, and then install like:
pkg install symbolic-win-py-bundle-2.9.0.tar.gz