Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First start of shng problem: pip3 log can't be created (Windows 10) #377

Open
onkelandy opened this issue Jan 7, 2021 · 4 comments
Open
Assignees
Milestone

Comments

@onkelandy
Copy link
Member

Some minor issue when running shng in Windows 10 with python 3.8.7 the first time. The pip3_outout.log can't be created automatically and therefore installation of reqs fails. Not sure if it's a Windows only problem

E:\smarthome>python3 bin/smarthome.py

test_requirements: 'ephem' not installed. Minimum v3.7 needed
....

Installing core requirements for the current user, please wait...
python_bin_path=C:\Users\test\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0
> using PIP command: 'C:\Users\test\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\scripts\pip.exe'
Traceback (most recent call last):
  File "bin/smarthome.py", line 116, in <module>
    core_reqs = shpypi.test_core_requirements(logging=False, pip3_command=args.pip3_command)
  File "E:\smarthome\lib\shpypi.py", line 245, in test_core_requirements
    if self.install_requirements('core', logging, pip3_command):
  File "E:\smarthome\lib\shpypi.py", line 390, in install_requirements
    with open(pip_log_name, 'w', encoding='utf8') as outfile:
FileNotFoundError: [Errno 2] No such file or directory: 'E:\\smarthome\\var\\log\\pip3_outout.log'

After creating the dir manually everything runs as expected.. actuall the automatic pip3 path is wrong (for whatever reason)

E:\smarthome>python3 bin/smarthome.py

test_requirements: 'ephem' not installed. Minimum v3.7 needed
....

Installing core requirements for the current user, please wait...
python_bin_path=C:\Users\test\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0
> using PIP command: 'C:\Users\test\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\scripts\pip.exe'

ERROR:
The system cannot find the path specified.

ERROR: Unable to install core requirements
Use the commandline option --pip3_command to specify the path to the command

But using the parameter pip3_command makes things run.

@msinn
Copy link
Member

msinn commented Jan 10, 2021

You know that windows is not yet officially supported?

@bmxp Since you are working on Windows compatibility, this could be of interest for you.

@bmxp
Copy link
Member

bmxp commented Jan 13, 2021

There is a main problem with the way SHNG is now handled in respect to restarts and install stuff.
For windows there should be no such thing like daemonzing and unix magics, windows has services. But since @msinn was working very hard to make restarts possible with linux systemd settings I waited for further work at this field. The whole sequence of restarting to install the dependencies is not optimal for windows.
I will see if I find some time for a solution after the next release...

@bmxp bmxp added this to the Version 1.9 milestone Jan 13, 2021
@bmxp
Copy link
Member

bmxp commented Apr 17, 2021

I fixed #377 in lib/shpypi.py with first creating the directories. This error might as well happen with a fresh install on Linux.
Maybe we should execute the createdirectories function from lib/smarthome.py as well in lib/shpypi.py as well...?

@bmxp bmxp modified the milestones: Version 1.9, Version 1.10 Dec 26, 2021
@onkelandy
Copy link
Member Author

Can we fix this issue and close it? Creating the dir whenever necessary is a useful approach I think. There should be a check whether the dir exists or not. @bmxp ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants