CounterFit-IoT / CounterFit

A simulator for IoT sensors and actuators. This creates fake virtual sensors and actuators when the real ones won't fit on your counter 🤪.
MIT License
200 stars 65 forks source link

CounterFit installation issue #18

Open anilkeshaw opened 1 year ago

anilkeshaw commented 1 year ago

Hi,

I'm trying to set up the CounterFit app however, getting the following error, and unable to proceed. I'm not sure if this is something related to the packages or python version it doesn't support.

Could you please see the below error snapshot and advise.

OS: Windows 10 Python Version : 3.11

(.venv) PS C:\nightlight> pip install CounterFit Collecting CounterFit Using cached CounterFit-0.1.4.dev6-py3-none-any.whl (119 kB) Collecting Flask==2.1.2 Using cached Flask-2.1.2-py3-none-any.whl (95 kB) Collecting Flask-SocketIO==5.2.0 Using cached Flask_SocketIO-5.2.0-py3-none-any.whl (17 kB) Collecting eventlet==0.33.1 Using cached eventlet-0.33.1-py2.py3-none-any.whl (226 kB) Collecting beautifulsoup4==4.9.3 Using cached beautifulsoup4-4.9.3-py3-none-any.whl (115 kB) Collecting lxml==4.6.4 Using cached lxml-4.6.4.tar.gz (3.2 MB) Preparing metadata (setup.py) ... done Requirement already satisfied: soupsieve>1.2 in c:\nightlight.venv\lib\site-packages (from beautifulsoup4==4.9.3->CounterFit) (2.3.2.post1) Collecting dnspython>=1.15.0 Using cached dnspython-2.2.1-py3-none-any.whl (269 kB) Collecting greenlet>=0.3 Using cached greenlet-2.0.1-cp311-cp311-win_amd64.whl (191 kB) Requirement already satisfied: six>=1.10.0 in c:\nightlight.venv\lib\site-packages (from eventlet==0.33.1->CounterFit) (1.16.0) Collecting Werkzeug>=2.0 Using cached Werkzeug-2.2.2-py3-none-any.whl (232 kB) Collecting Jinja2>=3.0 Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB) Collecting itsdangerous>=2.0 Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB) Collecting click>=8.0 Using cached click-8.1.3-py3-none-any.whl (96 kB) Collecting python-socketio>=5.0.2 Using cached python_socketio-5.7.2-py3-none-any.whl (56 kB) Collecting colorama Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB) Requirement already satisfied: MarkupSafe>=2.0 in c:\nightlight.venv\lib\site-packages (from Jinja2>=3.0->Flask==2.1.2->CounterFit) (2.1.1) Collecting bidict>=0.21.0 Using cached bidict-0.22.1-py3-none-any.whl (35 kB) Requirement already satisfied: python-engineio>=4.3.0 in c:\nightlight.venv\lib\site-packages (from python-socketio>=5.0.2->Flask-SocketIO==5.2.0->CounterFit) (4.3.4) Installing collected packages: Werkzeug, lxml, Jinja2, itsdangerous, greenlet, dnspython, colorama, bidict, beautifulsoup4, python-socketio, eventlet, click, Flask, Flask-SocketIO, CounterFit DEPRECATION: lxml is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for lxml ... error error: subprocess-exited-with-error

× Running setup.py install for lxml did not run successfully. │ exit code: 1 ╰─> [96 lines of output] Building lxml version 4.6.4. Building without Cython. Building against pre-built libxml2 andl libxslt libraries running install C:\nightlight.venv\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py creating build creating build\lib.win-amd64-cpython-311 creating build\lib.win-amd64-cpython-311\lxml copying src\lxml\builder.py -> build\lib.win-amd64-cpython-311\lxml copying src\lxml\cssselect.py -> build\lib.win-amd64-cpython-311\lxml copying src\lxml\doctestcompare.py -> build\lib.win-amd64-cpython-311\lxml copying src\lxml\ElementInclude.py -> build\lib.win-amd64-cpython-311\lxml copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-cpython-311\lxml copying src\lxml\sax.py -> build\lib.win-amd64-cpython-311\lxml copying src\lxml\usedoctest.py -> build\lib.win-amd64-cpython-311\lxml copying src\lxml_elementpath.py -> build\lib.win-amd64-cpython-311\lxml copying src\lxml__init.py -> build\lib.win-amd64-cpython-311\lxml creating build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes__init__.py -> build\lib.win-amd64-cpython-311\lxml\includes creating build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html\builder.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html\clean.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html\defs.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html\diff.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html\formfill.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html\html5parser.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html\soupparser.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html_diffcommand.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html_html5builder.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html_setmixin.py -> build\lib.win-amd64-cpython-311\lxml\html copying src\lxml\html\init.py -> build\lib.win-amd64-cpython-311\lxml\html creating build\lib.win-amd64-cpython-311\lxml\isoschematron copying src\lxml\isoschematron\init.py -> build\lib.win-amd64-cpython-311\lxml\isoschematron copying src\lxml\etree.h -> build\lib.win-amd64-cpython-311\lxml copying src\lxml\etree_api.h -> build\lib.win-amd64-cpython-311\lxml copying src\lxml\lxml.etree.h -> build\lib.win-amd64-cpython-311\lxml copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-cpython-311\lxml copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\config.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\init__.pxd -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-cpython-311\lxml\includes copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-cpython-311\lxml\includes creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\rng copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\rng creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 running build_ext building 'lxml.etree' extension creating build\temp.win-amd64-cpython-311 creating build\temp.win-amd64-cpython-311\Release creating build\temp.win-amd64-cpython-311\Release\src creating build\temp.win-amd64-cpython-311\Release\src\lxml "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc\lxml\includes -IC:\nightlight.venv\include -IC:\Users\anil.mishra\AppData\Local\Programs\Python\Python311\include -IC:\Users\anil.mishra\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc\lxml\etree.c /Fobuild\temp.win-amd64-cpython-311\Release\src\lxml\etree.obj -w cl : Command line warning D9025 : overriding '/W3' with '/w' etree.c src\lxml\etree.c(288): fatal error C1083: Cannot open include file: 'longintrepr.h': No such file or directory Compile failed: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe' failed with exit code 2 creating Users creating Users\ANIL~1.MIS creating Users\ANIL~1.MIS\AppData creating Users\ANIL~1.MIS\AppData\Local creating Users\ANIL~1.MIS\AppData\Local\Temp "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -I/usr/include/libxml2 "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /TcC:\Users\ANIL~1.MIS\AppData\Local\Temp\xmlXPathInitmxxtxnre.c /FoUsers\ANIL~1.MIS\AppData\Local\Temp\xmlXPathInitmxxtxnre.obj xmlXPathInitmxxtxnre.c C:\Users\ANIL~1.MIS\AppData\Local\Temp\xmlXPathInitmxxtxnre.c(1): fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe' failed with exit code 2


  Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
  *********************************************************************************
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> lxml

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

Thanks

jimbobbennett commented 1 year ago

Looks like on Windows you need to install libxml2. I've updated the README with instructions on how to do it, as well as updating CounterFit to have a dependency on a later version of this library.

Essentially:

  1. Download the wheel for lxml 4.9 from the Unofficial Windows Binaries for Python Extension Packages page
  2. Manually install this downloaded wheel with pip
  3. Install CounterFit as before

Let me know if the new steps work.

tosinosu commented 1 year ago

Windows: 10 Python Version: Python 3.7.9

The solution didn't work for me. I tried to install different versions but still got the same error. See the error message below

pip install lxml-4.9.0-cp39-cp39-win_amd64.whl ERROR: lxml-4.9.0-cp39-cp39-win_amd64.whl is not a supported wheel on this platform.

pip install lxml-4.9.0-pp38-pypy38_pp73-win_amd64.whl ERROR: lxml-4.9.0-pp38-pypy38_pp73-win_amd64.whl is not a supported wheel on this platform.

shubhushan49 commented 1 year ago

Hi, I had a similar problem. I first installed the eventlet package from pip and it worked fine. CounterFit will give you some errors regarding the eventlet version, you can simply ignore it.

jimbobbennett commented 1 year ago

@tosinosu - can you try with the latest version. I've removed the dependency on libxml