Skip to content

Winpython64-3.8.2.0: \settings\ folder not used and winpython.ini is ignored #839

Open

Description

@captaindet

as the subject indicates i have the following problems with Winpython64-3.8.2.0

a) \settings\ folder not used

all package settings (.CONFIG folders) are now stored in c:\Users\USER
this includes .ipython, .matplotlib, .spyder-py3 and others
while spyder is creating a little dummy \settings.spyder-py3, it does save all actual settings to c:\Users\USER.spyder-py3.

i like my settings being portable and want none of them in c:\Users\USER\

b) \settings\winpython.ini entries seems to be ignored too

typically, i change the defaults so that all settings/configs are stored where i have my python project located. something like:

[environment]
HOME = path-to-my-python-stuff
PYTHONPATH = path-to-my-python-stuff\lib-a;path-to-my-python-stuff\lib-b
WINPYWORKDIR = path-to-my-python-stuff\notebooks

however, this is now broken in the same way as (a), all settings end up in c:\Users\USER\ again, except for the additional dummy path-to-my-python-stuff.spyder-py3

this is with Winpython64-3.8.2.0

i am not upgrading every version. i have just upgraded from Winpython64-3.7.4.1 which did not have these issues.

Activity

  1. stonebig commented on Apr 17, 2020

    @stonebig
    Contributor

    I don't see a difference in the WinPython scripts themselves. Did you root cause what may have caused this change ?

  2. stonebig commented on Apr 17, 2020

    @stonebig
    Contributor

    interesting: it seems related to Python-3.8 itself

    WinPython-3.7.7.1 build1

    Python 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)] on win32
    >>> Type "copyright", "credits" or "license()" for more information.
    >>> from spyder.config.base import get_home_dir
    >>> get_home_dir()
     'C:...\\WPy64-3771b1\\settings'
    >>> import spyder
    >>> spyder.__version__
    '4.1.2'
    import os.path as osp
    >>> osp.expanduser('~')
     'C:...\\WPy64-3771b1\\settings'
    
    

    WinPython-3.8.2.1 build1

    Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
    Type "copyright", "credits" or "license()" for more information.
    >>> from spyder.config.base import get_home_dir
    >>> get_home_dir()
    'C:\\Users\\the_user'
    >>> import spyder
    >>> spyder.__version__
    '4.1.2'
    import os.path as osp
    >>> osp.expanduser('~')
    'C:\\Users\\the_user'
    
  3. stonebig commented on Apr 17, 2020

    @stonebig
    Contributor

    so were up to this problem in Python-3.8 not working as dreamed:

    import os.path as osp
    >>> osp.expanduser('~')
    

    ... where is that code on github ? ah , ok : python-3.7.7.amd64\Lib\os.py

  4. stonebig commented on Apr 17, 2020

    @stonebig
    Contributor

    Well, I don't truly find why under Python-3.8 , we get a different answer for

    import os.path as osp;osp.expanduser('~')
    

    @captaindet, could you inquire this, and look for a way to get it back to beloved 3.7 behavior ?

  5. stonebig commented on Apr 17, 2020

    @stonebig
    Contributor

    ok, found it. Now the variable looked for is USERPROFILE, no more HOME (at first).

    so if you simply tune your scripts\env.bat as follow, that should solves the issue:

    from

    set HOME=%WINPYDIRBASE%\settings
    rem set WINPYDIRBASE=
    

    to:

    set HOME=%WINPYDIRBASE%\settings
    set USERPROFILE=%HOME%
    rem set WINPYDIRBASE=
    

    it's a change in cpython in lib\pathlib.y:
    pathlib.py
    image

  6. stonebig commented on Apr 17, 2020

    @stonebig
    Contributor

    apparently .... it's a correction of "considered bad behavior" that has been done January 28th 2020, on python-3.8.2 and 3.9.0a5 (and NOT on Python-3.7, unchanged):

    https://bugs.python.org/issue36264

    python/cpython@c45a2aa

  7. stonebig commented on Apr 17, 2020

    @stonebig
    Contributor

    so the apparent solution is to specify USERPROFILE=%HOME%

  8. stonebig commented on Apr 17, 2020

    @stonebig
    Contributor

    you can try in next build, or just apply the one-liner in your current WinPython-3.8 and 3.9

  9. stonebig commented on Apr 17, 2020

    @stonebig
    Contributor

    image

  10. added a commit that references this issue on Apr 17, 2020
  11. captaindet commented on Apr 17, 2020

    @captaindet
    Author

    thanks stonebig for figuring out the root cause so fast.

    it seems like just adding
    USERPROFILE = %HOME%
    to the winpython.ini will do the trick already, without messing around with the env.bat.

    ultimately i wanted to redirect to my folder of choice anyway, which seems to work now if winpython.ini is changed to

    ...
    [environment]
    HOME =  path-to-my-python-stuff
    USERPROFILE = %HOME%
    ...
    
  12. stonebig commented on Apr 17, 2020

    @stonebig
    Contributor

    good remark

  13. stonebig commented on Apr 22, 2020

    @stonebig
    Contributor

    set USERPROFILE=%HOME% makes VSCode not starting.
    same error as here electron/electron#10054 (comment)

  14. stonebig commented on Apr 22, 2020

    @stonebig
    Contributor

    on VScode side, to get ipywidgets it needs settings.json change:

    {
    "python.pythonPath": "${env:WINPYDIR}\\python.exe",
    "python.dataScience.widgetScriptSources": [
    "jsdelivr.com",
    "unpkg.com"
    ],

    }

  15. stonebig commented on Apr 25, 2020

    @stonebig
    Contributor

    so... on Python-3.8 if we set USERPROFILE=%HOME% we have to pre-create:

    • %WINPYDIRBASE%\settings\AppData\Roaming
    • %WINPYDIRBASE%\settings\AppData\Local
    • %WINPYDIRBASE%\settings\AppData\LocalLow

    Otherwise VScode (Electron.js) blows-up

  16. stonebig commented on Apr 25, 2020

    @stonebig
    Contributor

    I don't dare setting USERPROFILE=%HOME% per default, as too much things then goes there.

    But the option is just for you to un-comment the line on env.bat

    as %WINPYDIRBASE%\settings\AppData\settings\Roaming is created, VSCode won't blow up like in electron/electron#10054 (comment)

  17. stonebig commented on Apr 25, 2020

    @stonebig
    Contributor

    there is also the scripts that we may invert the names, that can be of use or reworked later:

    • make_working_directory_be_not_winpython.bat
    • make_working_directory_be_winpython.bat
  18. RoyiAvital commented on Jun 14, 2020

    @RoyiAvital

    The problem is when Extracting the EXE (Installers) there is no configuration files in the Settings folder.
    Where are they?

    Is there a way to have the exact same experience with 3.8.3 as with previous releases?

  19. duperweb commented on Jan 24, 2023

    @duperweb

    So the reason that happened it is because you turn on the state and the wind python initiative files (winoython.ini) don't enabled the STATE, just let as it is or you can change the user profile to winpydirbase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions