SolidCode / SolidPython

A python frontend for solid modelling that compiles to OpenSCAD
1.12k stars 174 forks source link

Cannot install in windows 10 using "pip install solidpython" #188

Closed thephet closed 2 years ago

thephet commented 2 years ago

You can see the trace here. It seems to require to install visual studio tools, but this is over 6gbs and I dont want to install it.

Is there any other alternative?


(CS) C:\Users\Juanma>pip install solidpython
Collecting solidpython
  Using cached solidpython-1.1.1-py3-none-any.whl (86 kB)
Collecting PrettyTable==0.7.2
  Using cached prettytable-0.7.2.zip (28 kB)
  Preparing metadata (setup.py) ... done
Collecting pypng<0.0.20,>=0.0.19
  Using cached pypng-0.0.19.tar.gz (293 kB)
  Preparing metadata (setup.py) ... done
Collecting regex<2020.0,>=2019.4
  Using cached regex-2019.12.20.tar.gz (679 kB)
  Preparing metadata (setup.py) ... done
Collecting euclid3<0.2.0,>=0.1.0
  Using cached euclid3-0.01.tar.gz (13 kB)
  Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for PrettyTable, since package 'wheel' is not installed.
Using legacy 'setup.py install' for euclid3, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pypng, since package 'wheel' is not installed.
Using legacy 'setup.py install' for regex, since package 'wheel' is not installed.
Installing collected packages: regex, pypng, PrettyTable, euclid3, solidpython
    Running setup.py install for regex ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Juanma\CS\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Juanma\\AppData\\Local\\Temp\\pip-install-uu2y8x9w\\regex_d7af0b8bda4a4801bddf3a7d311ceadf\\setup.py'"'"'; __file__='"'"'C:\\Users\\Juanma\\AppData\\Local\\Temp\\pip-install-uu2y8x9w\\regex_d7af0b8bda4a4801bddf3a7d311ceadf\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Juanma\AppData\Local\Temp\pip-record-kk8gzn0b\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Juanma\CS\include\site\python3.9\regex'
         cwd: C:\Users\Juanma\AppData\Local\Temp\pip-install-uu2y8x9w\regex_d7af0b8bda4a4801bddf3a7d311ceadf\
    Complete output (13 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\regex
    copying regex_3\__init__.py -> build\lib.win-amd64-3.9\regex
    copying regex_3\regex.py -> build\lib.win-amd64-3.9\regex
    copying regex_3\_regex_core.py -> build\lib.win-amd64-3.9\regex
    copying regex_3\test_regex.py -> build\lib.win-amd64-3.9\regex
    running build_ext
    building 'regex._regex' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Juanma\CS\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Juanma\\AppData\\Local\\Temp\\pip-install-uu2y8x9w\\regex_d7af0b8bda4a4801bddf3a7d311ceadf\\setup.py'"'"'; __file__='"'"'C:\\Users\\Juanma\\AppData\\Local\\Temp\\pip-install-uu2y8x9w\\regex_d7af0b8bda4a4801bddf3a7d311ceadf\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Juanma\AppData\Local\Temp\pip-record-kk8gzn0b\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Juanma\CS\include\site\python3.9\regex' Check the logs for full command output.
jeff-dh commented 2 years ago

If I understand your output correctly the issue is, that the regex package depends on some Visual Studio library.

But I don't understand why solidpython (still) depends on regex. Since the current version should use py_scadparser (or is the pip version not updated yet?) I don't see why solidpython depends on the regex package and as far as I could figure it out neither does any of it's dependencies (maybe PrettyTable, couldn't figure out it's dependencies easily enough ;).

jeff-dh commented 2 years ago

Aah, I see: the py_scadparser update is not yet in pypi.

Sooo for now I think there's no way around installing the vs package for you unless you figure out why regex depends in vs-blablub and find a way around it. But that's a "non solidpython issue" :-p

But you could checkout the current master branch and use it, I does not depend on regex anymore.

jeff-dh commented 2 years ago

The reason why regex depends on vs-blablub could be the following: I could imagine that the regex module is mostly a C/C++ implementation using a python wrapper for performance reasons. Furthermore it seems that you're pip command issued a "build" of regex and thus needs a compiler.

I'm not into the details of pip installations, but there's something about "wheel"(s) which -- I guess! -- are some kind of binary packages. Your output says:

 Using legacy 'setup.py install' for regex, since package 'wheel' is not installed.

I would take a look at this wheel stuff and probably just try to install the "wheel" package, you might(!) be lucky to then be able to install a precompiled binary regex package without needing to install vs-blablub.

thephet commented 2 years ago

I installed the wheel package, but the error is still there:

(CS) C:\Users\Juanma>pip install wheel
Requirement already satisfied: wheel in c:\users\juanma\cs\lib\site-packages (0.37.0)

(CS) C:\Users\Juanma>pip install solidpython
Collecting solidpython
  Using cached solidpython-1.1.1-py3-none-any.whl (86 kB)
Collecting euclid3<0.2.0,>=0.1.0
  Using cached euclid3-0.01.tar.gz (13 kB)
  Preparing metadata (setup.py) ... done
Collecting pypng<0.0.20,>=0.0.19
  Using cached pypng-0.0.19.tar.gz (293 kB)
  Preparing metadata (setup.py) ... done
Collecting PrettyTable==0.7.2
  Using cached prettytable-0.7.2.zip (28 kB)
  Preparing metadata (setup.py) ... done
Collecting regex<2020.0,>=2019.4
  Using cached regex-2019.12.20.tar.gz (679 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: PrettyTable, euclid3, pypng, regex
  Building wheel for PrettyTable (setup.py) ... done
  Created wheel for PrettyTable: filename=prettytable-0.7.2-py3-none-any.whl size=13714 sha256=33573bb6dcb3d12bfa0d8cf8e3a1281ed99936135010a489d5e323066681188c
  Stored in directory: c:\users\juanma\appdata\local\pip\cache\wheels\75\f7\28\77a076f1fa8cbeda61aca712815d04d7a32435f04a26a2dd7b
  Building wheel for euclid3 (setup.py) ... done
  Created wheel for euclid3: filename=euclid3-0.1-py3-none-any.whl size=13254 sha256=b44e4ac79e127e55bf305c24f57c71e38494b2144ca8c00076bf5078898a0bda
  Stored in directory: c:\users\juanma\appdata\local\pip\cache\wheels\18\be\4f\133bfad6a65834092589685a36d163d6df50d500453f431cf7
  Building wheel for pypng (setup.py) ... done
  Created wheel for pypng: filename=pypng-0.0.19-py3-none-any.whl size=53318 sha256=fc04ef362883f751c281efe71b6ee8e56934417b9741d71424e4bfec89e528cb
  Stored in directory: c:\users\juanma\appdata\local\pip\cache\wheels\68\1d\98\e1960b10ab5d6106bb5e8949dadfedf7822a3235d92aefc454
  Building wheel for regex (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Juanma\CS\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Juanma\\AppData\\Local\\Temp\\pip-install-r8sk01ap\\regex_80056fec0ed4491c87849b7c62aa9084\\setup.py'"'"'; __file__='"'"'C:\\Users\\Juanma\\AppData\\Local\\Temp\\pip-install-r8sk01ap\\regex_80056fec0ed4491c87849b7c62aa9084\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Juanma\AppData\Local\Temp\pip-wheel-jbryovns'
       cwd: C:\Users\Juanma\AppData\Local\Temp\pip-install-r8sk01ap\regex_80056fec0ed4491c87849b7c62aa9084\
  Complete output (13 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\regex
  copying regex_3\__init__.py -> build\lib.win-amd64-3.9\regex
  copying regex_3\regex.py -> build\lib.win-amd64-3.9\regex
  copying regex_3\_regex_core.py -> build\lib.win-amd64-3.9\regex
  copying regex_3\test_regex.py -> build\lib.win-amd64-3.9\regex
  running build_ext
  building 'regex._regex' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for regex
  Running setup.py clean for regex
Successfully built PrettyTable euclid3 pypng
Failed to build regex
Installing collected packages: regex, pypng, PrettyTable, euclid3, solidpython
    Running setup.py install for regex ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Juanma\CS\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Juanma\\AppData\\Local\\Temp\\pip-install-r8sk01ap\\regex_80056fec0ed4491c87849b7c62aa9084\\setup.py'"'"'; __file__='"'"'C:\\Users\\Juanma\\AppData\\Local\\Temp\\pip-install-r8sk01ap\\regex_80056fec0ed4491c87849b7c62aa9084\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Juanma\AppData\Local\Temp\pip-record-4nxgn_p2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Juanma\CS\include\site\python3.9\regex'
         cwd: C:\Users\Juanma\AppData\Local\Temp\pip-install-r8sk01ap\regex_80056fec0ed4491c87849b7c62aa9084\
    Complete output (13 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\regex
    copying regex_3\__init__.py -> build\lib.win-amd64-3.9\regex
    copying regex_3\regex.py -> build\lib.win-amd64-3.9\regex
    copying regex_3\_regex_core.py -> build\lib.win-amd64-3.9\regex
    copying regex_3\test_regex.py -> build\lib.win-amd64-3.9\regex
    running build_ext
    building 'regex._regex' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Juanma\CS\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Juanma\\AppData\\Local\\Temp\\pip-install-r8sk01ap\\regex_80056fec0ed4491c87849b7c62aa9084\\setup.py'"'"'; __file__='"'"'C:\\Users\\Juanma\\AppData\\Local\\Temp\\pip-install-r8sk01ap\\regex_80056fec0ed4491c87849b7c62aa9084\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Juanma\AppData\Local\Temp\pip-record-4nxgn_p2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Juanma\CS\include\site\python3.9\regex' Check the logs for full command output.
thephet commented 2 years ago

I just did a "pip install regex" and it was fine. It installed 2021.10.8. Your project forces regex to be regex<2020.0,>=2019.4. I wonder if you could let it use the last version of regex, because then it'd install.

BTW thank you very much for your help.

etjones commented 2 years ago

I’m glad that worked out. We’ve removed the regex dependency entirely in the master branch, so with luck, no one else will run into your difficulties once that’s released. Happy modeling!

thephet commented 2 years ago

I guess the question is when will you upload the non regex version to pip?