sibson/vncdotool

[BUG] pip installation fails (somehow)

Closed this issue · 3 comments

C:\Program Files\Spyder\Python>python --version
Python 3.7.9

C:\Program Files\Spyder\Python>python -m pip install --upgrade pip
Requirement already satisfied: pip in c:\program files\spyder\python\lib\site-packages (21.3.1)

C:\Program Files\Spyder\Python>python -m pip cache purge
Files removed: 1

C:\Program Files\Spyder\Python>set
HOMEDRIVE=C:
HOMEPATH=\Users\dkoch
NUMBER_OF_PROCESSORS=4
OS=Windows_NT
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\windows\SysWow64;C:\Program Files\Spyder\Python;C:\Program Files\Spyder\Python\Lib;C:\Program Files\Spyder\Python\Scripts;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_ARCHITEW6432=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=4e03
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files (x86)
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PYSDL2_DLL_PATH=C:\Program Files\Spyder\lib
PYTHONHOME=C:\Program Files\Spyder\Python
PYTHONPATH=C:\Program Files\Spyder\Python;C:\Program Files\Spyder\Python\Lib;C:\Program Files\Spyder\Python\Scripts
SystemDrive=C:
SystemRoot=C:\WINDOWS
windir=C:\WINDOWS
[...]

C:\Program Files\Spyder\Python>python -m pip install --upgrade vncdotool
Collecting vncdotool
  Downloading vncdotool-1.0.0.tar.gz (50 kB)
     |████████████████████████████████| 50 kB 615 kB/s
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files\Spyder\Python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dkoch\\AppData\\Local\\Temp\\pip-install-51505rcy\\vncdotool_b312807932714ed9b6eac008aaaec63c\\setup.py'"'"'; __file__='"'"'C:\\Users\\dkoch\\AppData\\Local\\Temp\\pip-install-51505rcy\\vncdotool_b312807932714ed9b6eac008aaaec63c\\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'"'"'))' egg_info --egg-base 'C:\Users\dkoch\AppData\Local\Temp\pip-pip-egg-info-wm5kkaxt'
       cwd: C:\Users\dkoch\AppData\Local\Temp\pip-install-51505rcy\vncdotool_b312807932714ed9b6eac008aaaec63c\
  Complete output (5 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\dkoch\AppData\Local\Temp\pip-install-51505rcy\vncdotool_b312807932714ed9b6eac008aaaec63c\setup.py", line 4, in <module>
      from vncdotool import __version__
  ModuleNotFoundError: No module named 'vncdotool'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/8e/c6/6d145d564906d0d9392c4a9910a7c56ba8210f12532c1b4c1f3b626e7d91/vncdotool-1.0.0.tar.gz#sha256=5b1670c6923a9408aec7825d8087e0de3a7f5bc9bd6fa590b7e1727879347e0c (from https://pypi.org/simple/vncdotool/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading vncdotool-0.13.0.tar.gz (62 kB)
     |████████████████████████████████| 62 kB 314 kB/s
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files\Spyder\Python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dkoch\\AppData\\Local\\Temp\\pip-install-51505rcy\\vncdotool_62615541a12e4c95bb1a37a94afef398\\setup.py'"'"'; __file__='"'"'C:\\Users\\dkoch\\AppData\\Local\\Temp\\pip-install-51505rcy\\vncdotool_62615541a12e4c95bb1a37a94afef398\\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'"'"'))' egg_info --egg-base 'C:\Users\dkoch\AppData\Local\Temp\pip-pip-egg-info-j6nhoyka'
       cwd: C:\Users\dkoch\AppData\Local\Temp\pip-install-51505rcy\vncdotool_62615541a12e4c95bb1a37a94afef398\
  Complete output (5 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\dkoch\AppData\Local\Temp\pip-install-51505rcy\vncdotool_62615541a12e4c95bb1a37a94afef398\setup.py", line 4, in <module>
      from vncdotool import __version__
  ModuleNotFoundError: No module named 'vncdotool'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/16/e4/befb32220fb4b05538e09901a3d6555f075d670a401011f3fe510f1f17da/vncdotool-0.13.0.tar.gz#sha256=762083a233c0fd2d3caefad974f85188661fa363ecb9d3d1df6dabc53bdaf796 (from https://pypi.org/simple/vncdotool/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading vncdotool-0.12.1.tar.gz (62 kB)
     |████████████████████████████████| 62 kB 282 kB/s
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files\Spyder\Python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dkoch\\AppData\\Local\\Temp\\pip-install-51505rcy\\vncdotool_42e48cc76a334477bdd4d6eecde8e04b\\setup.py'"'"'; __file__='"'"'C:\\Users\\dkoch\\AppData\\Local\\Temp\\pip-install-51505rcy\\vncdotool_42e48cc76a334477bdd4d6eecde8e04b\\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'"'"'))' egg_info --egg-base 'C:\Users\dkoch\AppData\Local\Temp\pip-pip-egg-info-q41qthdz'
       cwd: C:\Users\dkoch\AppData\Local\Temp\pip-install-51505rcy\vncdotool_42e48cc76a334477bdd4d6eecde8e04b\
  Complete output (5 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\dkoch\AppData\Local\Temp\pip-install-51505rcy\vncdotool_42e48cc76a334477bdd4d6eecde8e04b\setup.py", line 4, in <module>
      from vncdotool import __version__
  ModuleNotFoundError: No module named 'vncdotool'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/93/88/6036d22decbc4c7f08e6dd8a3210cbf83fc7dc8ea4a6b9440fc57f502a4d/vncdotool-0.12.1.tar.gz#sha256=59a3919b65a46ebce2d4e65f954cd230d4bbc51bfc5878af75af47951f0c5321 (from https://pypi.org/simple/vncdotool/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading vncdotool-0.12.0.tar.gz (63 kB)
     |████████████████████████████████| 63 kB 626 kB/s
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files\Spyder\Python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dkoch\\AppData\\Local\\Temp\\pip-install-51505rcy\\vncdotool_83dc9110b6884de8ac4eb4ad9b4d843a\\setup.py'"'"'; __file__='"'"'C:\\Users\\dkoch\\AppData\\Local\\Temp\\pip-install-51505rcy\\vncdotool_83dc9110b6884de8ac4eb4ad9b4d843a\\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'"'"'))' egg_info --egg-base 'C:\Users\dkoch\AppData\Local\Temp\pip-pip-egg-info-mx62_d3y'
       cwd: C:\Users\dkoch\AppData\Local\Temp\pip-install-51505rcy\vncdotool_83dc9110b6884de8ac4eb4ad9b4d843a\
  Complete output (5 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\dkoch\AppData\Local\Temp\pip-install-51505rcy\vncdotool_83dc9110b6884de8ac4eb4ad9b4d843a\setup.py", line 4, in <module>
      from vncdotool import __version__
  ModuleNotFoundError: No module named 'vncdotool'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/2f/99/c5dfe95a64b203c113735d4bc86428b87ebb1dfc45b7322bdbbaf2b6b06d/vncdotool-0.12.0.tar.gz#sha256=b67430eb5dbfa83568b5a511e406f7dbbf261e1f5e3c295a393368121a3fd99d (from https://pypi.org/simple/vncdotool/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading vncdotool-0.11.2.tar.gz (61 kB)
     |████████████████████████████████| 61 kB 1.3 MB/s
  Preparing metadata (setup.py) ... done
Requirement already satisfied: Twisted in c:\program files\spyder\python\lib\site-packages (from vncdotool) (21.7.0)
Requirement already satisfied: Pillow in c:\program files\spyder\pkgs (from vncdotool) (8.3.2)
Requirement already satisfied: zope.interface>=4.4.2 in c:\program files\spyder\python\lib\site-packages (from Twisted->vncdotool) (5.4.0)
Requirement already satisfied: typing-extensions>=3.6.5 in c:\program files\spyder\pkgs (from Twisted->vncdotool) (3.10.0.2)
Requirement already satisfied: hyperlink>=17.1.1 in c:\program files\spyder\python\lib\site-packages (from Twisted->vncdotool) (21.0.0)
Requirement already satisfied: incremental>=21.3.0 in c:\program files\spyder\python\lib\site-packages (from Twisted->vncdotool) (21.3.0)
Requirement already satisfied: attrs>=19.2.0 in c:\program files\spyder\pkgs (from Twisted->vncdotool) (21.2.0)
Requirement already satisfied: Automat>=0.8.0 in c:\program files\spyder\python\lib\site-packages (from Twisted->vncdotool) (20.2.0)
Requirement already satisfied: twisted-iocpsupport~=1.0.0 in c:\program files\spyder\python\lib\site-packages (from Twisted->vncdotool) (1.0.2)
Requirement already satisfied: constantly>=15.1 in c:\program files\spyder\python\lib\site-packages (from Twisted->vncdotool) (15.1.0)
Requirement already satisfied: six in c:\program files\spyder\pkgs (from Automat>=0.8.0->Twisted->vncdotool) (1.16.0)
Requirement already satisfied: idna>=2.5 in c:\program files\spyder\pkgs (from hyperlink>=17.1.1->Twisted->vncdotool) (3.2)
Requirement already satisfied: setuptools in c:\program files\spyder\pkgs (from zope.interface>=4.4.2->Twisted->vncdotool) (58.0.4)
Building wheels for collected packages: vncdotool
  Building wheel for vncdotool (setup.py) ... done
  Created wheel for vncdotool: filename=vncdotool-0.11.2-py3-none-any.whl size=29277 sha256=75daf0437660f22432968573efa8debf9bcadbfb5868278c6c49cd9b3640d853
  Stored in directory: c:\users\dkoch\appdata\local\pip\cache\wheels\b3\fc\cf\c6e0cec5266ce8fd930ea22581dc81f61a88fbfaa2c5f82fcf
Successfully built vncdotool
Installing collected packages: vncdotool
Successfully installed vncdotool-0.11.2

C:\Program Files\Spyder\Python>

Really ModuleNotFoundError: No module named 'vncdotool' ?

Try this in your files :

import os
import sys

sys.path.append(os.path.dirname(os.path.abspath(__file__)))

Looks like windows install doesn't have the module on the path during install, whereas linux does somehow. This is the problem, https://github.com/sibson/vncdotool/blob/main/setup.py#L4

You're not the only one, I solved the same issue the same way, there's even a "repo" for it :

nucleic/enaml#460

This issue is solved by #235, which converted setuptools to use version = attr: vncdotool.__version__ from setup.cfg instead, which removed the requirement for vncdotool/__init__.py to be available during package build time.

I verified the build via GitHub actions running now also on Windows, but needs one more fix as socket.AF_UNIX is undefined on (older) Windows versions. See #237