drov0 / python-imagesearch

A wrapper around opencv2 and pyautogui to do image searching easily.
MIT License
280 stars 99 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt' #27

Closed culcube closed 3 years ago

culcube commented 3 years ago

Since the Nov 9th update "pip3 install python-imagesearch-drov0" fails as no requirements.txt file is found. Tested with both Win 10 and Ubuntu 20.04.1 LTS

culcube commented 3 years ago

As a workaround you can use a while true loop to copy the requirements file to the relevant place, as soon as it's created by the pip install.

Get the file from https://raw.githubusercontent.com/drov0/python-imagesearch/master/requirements.txt Then set up a loop to try to copy the file into the relevant folder:

On Linux: while true; do cp requirements.txt /tmp/pip-install*/python-imageseach-drov0;done

On Windows the relevant folder isn't in /tmp but the temporary part of the local AppData: C:\Users\$username\AppData\Local\Temp\pip-install*\python-imageseach-drov0

Then run the pip install.

icantreallycodethatwell commented 3 years ago

I've tried writing a loop that does this, but can't seem to get it done it tried the write() function and also read through this page on stackoverflow but nothing seems to acutally let me download the library, Can you help?

Nickel91 commented 3 years ago

@culcube 's workaround works fine.

For windows: make a folder that contains said .txt file and create a script.ps1: while($true) { $TARGET = Get-ChildItem -Path "C:\Users\YOURUSERNAME\AppData\Local\Temp\pip-install*\python-imageseach-drov0\" Copy-Item "C:\PATH-TO-WHERE-YOU-PUT-YOUR\requirements.txt" -Destination $TARGET }

  1. Run a Powershell as Admin
  2. set-executionpolicy remotesigned
  3. Navigate to folder with script
  4. .\script.ps1
  5. in a seperate CMD run your pip install command (pip install python-imageseach-drov0)
  6. Once installed abort your loop with Ctrl+c
  7. Don't forget to set-executionpolicy restricted
  8. Doublecheck with Get-ExecutionPolicy
drov0 commented 3 years ago

Hello,

Really sorry to see you had to resort to such hacky methods, I didn't notice the issue sooner.

I've pushed 1.1.1 which should fix the issue.

@Wurstpeter could you tell me if you still experience issues ?

Nickel91 commented 3 years ago

@drov0 thanks for your fix :) I have reinstalled the package (without the workaround, with just the pip command) and it worked just fine!