horczech / sudoku

Read numbers from sudoku image
1 stars 1 forks source link

Issue with dependencies when creating the virtual environment #1

Closed AntonReinhard closed 5 years ago

AntonReinhard commented 5 years ago

So I'm trying to set this up, I installed miniconda and when I try to run the first command I get this:

$ /opt/miniconda3/bin/conda env update --file environment.yml 
Collecting package metadata: done
Solving environment: failed

ResolvePackageNotFound: 
  - pixman==0.38.0=h1de35cc_0
  - py-opencv==3.4.2=py37h7c891bd_1
  - libopus==1.3=h1de35cc_0
  - freetype==2.9.1=hb4e5f40_0
  - zstd==1.3.7=h5bba6e5_0
  - openssl==1.1.1b=h1de35cc_1
  - libxml2==2.9.9=hab757c2_0
  - glib==2.56.2=hd9629dc_0
  - jpeg==9b=he5867d9_2
  - tk==8.6.8=ha441bb4_0
  - libffi==3.2.1=h475c297_4
  - icu==58.2=h4b95b61_1
  - xz==5.2.4=h1de35cc_4
  - bzip2==1.0.6=h1de35cc_5
  - jasper==2.0.14=h636a363_1
  - libvpx==1.7.0=h378b8a2_0
  - cairo==1.14.12=hc4e6be7_4
  - sqlite==3.27.2=ha441bb4_0
  - numpy==1.16.2=py37hacdab7b_0
  - pcre==8.43=h0a44026_0
  - graphite2==1.3.13=h2098e52_0
  - libedit==3.1.20181209=hb402a30_0
  - numpy-base==1.16.2=py37h6575580_0
  - mkl_fft==1.0.10=py37h5e564d8_0
  - fontconfig==2.13.0=h5d5b041_1
  - ncurses==6.1=h0a44026_1
  - zlib==1.2.11=h1de35cc_3
  - readline==7.0=h1de35cc_5
  - ffmpeg==4.0=h01ea3c9_0
  - harfbuzz==1.8.8=hb8d4a28_0
  - libopencv==3.4.2=h7c891bd_1
  - python==3.7.2=haf84260_0
  - libtiff==4.0.10=hcb84e12_2
  - libpng==1.6.36=ha441bb4_0
  - hdf5==1.10.2=hfa1e0ec_1
  - mkl_random==1.0.2=py37h27c97d8_0
  - libgfortran==3.0.1=h93005f0_2
  - scipy==1.2.1=py37h1410ff5_0
  - libiconv==1.15=hdd342a3_7
  - pyyaml==5.1=py37h1de35cc_0
  - yaml==0.1.7=hc338f04_2
  - kiwisolver==1.0.1=py37h0a44026_0
  - pandas==0.24.2=py37h0a44026_0
  - scikit-learn==0.20.3=py37h27c97d8_0
  - libcxxabi==4.0.1=hcfea43d_1
  - tornado==6.0.1=py37h1de35cc_0
  - gettext==0.19.8.1=h15daf44_3
  - libcxx==4.0.1=hcfea43d_1
  - matplotlib==3.0.3=py37h54f8f79_0

I googled this and found to put the dependencies that don't work in the "pip:" section in the .yaml I did that, but it still doesn't work:

Pip subprocess error:
  Could not find a version that satisfies the requirement bzip2==1.0.6 (from -r /home/rubydragon/Programming/sudoku_reader/sudoku/condaenv.uhwmwosd.requirements.txt (line 2)) (from versions: )
No matching distribution found for bzip2==1.0.6 (from -r /home/rubydragon/Programming/sudoku_reader/sudoku/condaenv.uhwmwosd.requirements.txt (line 2))
horczech commented 5 years ago

I generated new environment.yml file and updated README file so try it one more time and if it won't work let me know, please.

AntonReinhard commented 5 years ago

Okay, I reinstalled Anaconda from the link in the readme, recloned the repository but it still gives me a bunch of "ResolvePackageNotFound:" Errors.

horczech commented 5 years ago

What operating system system do u use?

AntonReinhard commented 5 years ago

I'm on Linux, Antergos

horczech commented 5 years ago

I don't have too much time to look deeper into this problem today. It seems like the problem might be that I've generated enviroment.yml file on mac os and Linux has some problem with it. But if you want to make it run you can install the necessary libraries manually. By quickly looking at the enviroment.yml file you have to install the following libraries: python=3.6.8, keras=2.2.4, matplotlib=3.0.2, numpy=1.16.2, pandas=0.23.4, pytest=4.1.0, scipy=1.2.1, yaml=0.1.7, zlib=1.2.11, opencv-python==4.1.0.25

If you will do it with anaconda it should also automatically install all dependencies.

If you will decide to do it this way and it will work please generate and share your enviroment.yml file. Thanks

AntonReinhard commented 5 years ago

Okay, I made the environment myself now and it looks like all dependencies are there now. However, now when I try running the solver it tells me

$ python3 sudoku_solver.py sudoku_imgs/web_cam/webcam_clean_1.jpg 
Using TensorFlow backend.
Unable to open file (file signature not found)

From googling it looks like that error comes from h5py? But I'm not sure how that works or where and if you use it.

I attached the environment file: environment_linux.yml.zip

horczech commented 5 years ago

Thats weird I thought that it will be installed together with keras. Try to install h5py=2.8.0

thanks for patience :D

AntonReinhard commented 5 years ago

That package is already installed.

Since it's saying "file signature not found": I noticed that the jpg images of the sudokus you use seem to have some kind of broken signature. E.g. Gimp tells me "Not a JPEG file: starts with 0x76 0x65" I fixed it for one of them so gimp can open it, but the error in your code still occurs. So it probably has nothing to do with it...

AntonReinhard commented 5 years ago

Ok, sorry, that seems to have been fixed by me pulling the newest version, I guess I can close this now.