You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fp = open(temp, 'r') FileNotFoundError: [Errno 2] No such file or directory: #8
Traceback (most recent call last):
File "YOUR_FILE.py", line 29, in
lines = lsd(gray)
File "C:\YOUR_WORKING_DIRECTORY\pylsd_repo\pylsd\lsd.py", line 24, in lsd
fp = open(temp, 'r')
FileNotFoundError: [Errno 2] No such file or directory: 'C:/YOUR_WORKING_DIRECTORY/536135ntl.txt'
Using Windows, if you installed it using source code, may be this is happening to you. I just faced it and resolved it using a quick (its nasty but works) fix.
open lsd.py and put a print(temp) just when temp has been created, this gives the path where temp file is created
A file would be created every time at this location, but the name is not as per expected, due to some reasons. (EXPECTED: randomno+ntl.txt, ACTUAL: C - in my case)
just replace temp by this new path(location of file+C) at two places - a) where it is read again b) in remove
@getsanjeev
Yep!Just Replace 15th line code temp = os.path.abspath(str(np.random.randint( 1, 1000000)) + 'ntl.txt').replace('\\', '/') in this file "pylsd/pylsd/lsd.py" to temp='a'.
I just run this code on windows
Reacted by Sanjeev Dubey, shiyi000, YingKK, ygest, JFanL, LeenluTo and Jack Zhao
Just replace 15th line and 20th line in pylsd/pylsd/lsd.py as follows: # temp = os.path.abspath(str(np.random.randint(1, 1000000)) + 'ntl.txt').replace('\\', '/') temp = os.path.abspath(str(np.random.randint(1, 1000000)) + 'ntl.txt').replace('\\', '/').encode('utf-8') # lsdlib.lsdGet(src, ctypes.c_int(rows), ctypes.c_int(cols), temp) lsdlib.lsdGet(src, ctypes.c_int(rows), ctypes.c_int(cols), ctypes.c_char_p(temp))
Reacted by David Xiang and Benjamin-wzq
Reacted by Victor Fleurant, Julien L'hoest, Suryakant Tibrewal, pqryosuke, Fahmida Pervin Brishty, samo1petar, Harsh Bhamore, Huseyin ERDEM, huhulaoxian, David Xiang and 2 more
Reacted by Suryakant Tibrewal, pqryosuke and BUI DINH MINH
I upgraded the lsd algorithm version from 1.5 to 1.6, and solved the FileNotFoundError. Now it works on python3.
You can install it with pip install pylsd2
Activity
getsanjeev commentedon Jun 17, 2018
Using Windows, if you installed it using source code, may be this is happening to you. I just faced it and resolved it using a quick (its nasty but works) fix.
belnasty commentedon Jun 27, 2018
@getsanjeev great work!
Sorrowly, it does not work for Linux. Probably, you have any ideas for it too?
getsanjeev commentedon Jun 27, 2018
Yes it does not work on Linux, I would update for Linux, let me figure out something.
sevenHsu commentedon Jul 6, 2018
@getsanjeev
Yep!Just Replace 15th line code
temp = os.path.abspath(str(np.random.randint( 1, 1000000)) + 'ntl.txt').replace('\\', '/')in this file "pylsd/pylsd/lsd.py" totemp='a'.I just run this code on windows
dlinzhao commentedon May 18, 2019
Just replace 15th line and 20th line in pylsd/pylsd/lsd.py as follows:
# temp = os.path.abspath(str(np.random.randint(1, 1000000)) + 'ntl.txt').replace('\\', '/')temp = os.path.abspath(str(np.random.randint(1, 1000000)) + 'ntl.txt').replace('\\', '/').encode('utf-8')# lsdlib.lsdGet(src, ctypes.c_int(rows), ctypes.c_int(cols), temp)lsdlib.lsdGet(src, ctypes.c_int(rows), ctypes.c_int(cols), ctypes.c_char_p(temp))anyongjin commentedon Jun 10, 2021
I upgraded the lsd algorithm version from 1.5 to 1.6, and solved the FileNotFoundError. Now it works on python3.
You can install it with
pip install pylsd2