Forum Discussion

andyt's avatar
andyt
New Contributor
17 days ago

Python 3.14 and SDK example.py

The python example.py script worked with python 3.13 after following the setup instructions.

 

For python 3.14 the following error occurs:

 

# Connects to 1Password.

client = await Client.authenticate(

                                  auth=token,

# Set the following to your own integration name and version.

 

Exception has occurred: NameError
name 'Client' is not defined

 

 Has the example.py script been run under python 3.14?

Should the script not have this error with python 3.14?

 

4 Replies

  • andyt's avatar
    andyt
    New Contributor

    The same error occurs. Built within a venv. Only package installed.
    The last few lines are listed below. Seems machine Windows has an issue.

    self.link = platform_links[self.system][machine]
                        ~~~~~~~~~~~~~~^^^^^^^^^^^^^
    KeyError: 'Windows'
    [end of output]

    Collecting 1password
      Using cached 1password-1.1.3.tar.gz (15 kB)
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
      Installing backend dependencies: started
      Installing backend dependencies: finished with status 'done'
      Preparing metadata (pyproject.toml): started
      Preparing metadata (pyproject.toml): finished with status 'done'
    Collecting wget (from 1password)
      Using cached wget-3.2-py3-none-any.whl
    Collecting pyyaml (from 1password)
      Using cached pyyaml-6.0.3-cp314-cp314-win_amd64.whl.metadata (2.4 kB)
    Collecting pycryptodome (from 1password)
      Using cached pycryptodome-3.23.0-cp37-abi3-win_amd64.whl.metadata (3.5 kB)
    Collecting pexpect (from 1password)
      Using cached pexpect-4.9.0-py2.py3-none-any.whl.metadata (2.5 kB)
    Collecting ptyprocess>=0.5 (from pexpect->1password)
      Using cached ptyprocess-0.7.0-py2.py3-none-any.whl.metadata (1.3 kB)
    Using cached pexpect-4.9.0-py2.py3-none-any.whl (63 kB)
    Using cached ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
    Using cached pycryptodome-3.23.0-cp37-abi3-win_amd64.whl (1.8 MB)
    Using cached pyyaml-6.0.3-cp314-cp314-win_amd64.whl (156 kB)
    Building wheels for collected packages: 1password
      Building wheel for 1password (pyproject.toml): started
      Building wheel for 1password (pyproject.toml): finished with status 'error'
      error: subprocess-exited-with-error
      
      Building wheel for 1password (pyproject.toml) did not run successfully.
      exit code: 1
      
      [116 lines of output]
      C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\_distutils\dist.py:289: UserWarning: Unknown distribution option: 'tests_require'
        warnings.warn(msg)
      C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\_distutils\dist.py:289: UserWarning: Unknown distribution option: 'test_suite'
        warnings.warn(msg)
      C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\dist.py:765: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: MIT License
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_py
      creating build\lib\onepassword
      copying onepassword\client.py -> build\lib\onepassword
      copying onepassword\exceptions.py -> build\lib\onepassword
      copying onepassword\utils.py -> build\lib\onepassword
      copying onepassword\__init__.py -> build\lib\onepassword
      installing to build\bdist.win-amd64\wheel
      running install
      running install_lib
      creating build\bdist.win-amd64\wheel
      creating build\bdist.win-amd64\wheel\onepassword
      copying build\lib\onepassword\client.py -> build\bdist.win-amd64\wheel\.\onepassword
      copying build\lib\onepassword\exceptions.py -> build\bdist.win-amd64\wheel\.\onepassword
      copying build\lib\onepassword\utils.py -> build\bdist.win-amd64\wheel\.\onepassword
      copying build\lib\onepassword\__init__.py -> build\bdist.win-amd64\wheel\.\onepassword
      running install_egg_info
      running egg_info
      writing 1password.egg-info\PKG-INFO
      writing dependency_links to 1password.egg-info\dependency_links.txt
      writing requirements to 1password.egg-info\requires.txt
      writing top-level names to 1password.egg-info\top_level.txt
      reading manifest file '1password.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE.txt'
      writing manifest file '1password.egg-info\SOURCES.txt'
      Copying 1password.egg-info to build\bdist.win-amd64\wheel\.\1password-1.1.3-py3.14.egg-info
      running install_scripts
      Traceback (most recent call last):
        File "D:\test\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "D:\test\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "D:\test\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 280, in build_wheel
          return _build_backend().build_wheel(
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
              wheel_directory, config_settings, metadata_directory
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          )
          ^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\build_meta.py", line 439, in build_wheel
          return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\build_meta.py", line 427, in _build
          return self._build_with_temp_dir(
                 ~~~~~~~~~~~~~~~~~~~~~~~~~^
              cmd,
              ^^^^
          ...<3 lines>...
              self._arbitrary_args(config_settings),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          )
          ^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\build_meta.py", line 408, in _build_with_temp_dir
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\build_meta.py", line 518, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 34, in <module>
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)  # type: ignore[return-value]
                 ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 186, in setup
          return run_commands(dist)
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 202, in run_commands
          dist.run_commands()
          ~~~~~~~~~~~~~~~~~^^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1002, in run_commands
          self.run_command(cmd)
          ~~~~~~~~~~~~~~~~^^^^^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\dist.py", line 1107, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1021, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\command\bdist_wheel.py", line 405, in run
          self.run_command("install")
          ~~~~~~~~~~~~~~~~^^^^^^^^^^^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 357, in run_command
          self.distribution.run_command(command)
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\dist.py", line 1107, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\Andy\AppData\Local\Temp\pip-build-env-w2gnr77p\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1021, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "<string>", line 21, in run
        File "C:\Users\Andy\AppData\Local\Temp\pip-install-8rnd3_36\1password_c19a17e5ded540ff92d217e7f34e7de3\install_op.py", line 88, in __init__
          self.link = platform_links[self.system][machine]
                      ~~~~~~~~~~~~~~^^^^^^^^^^^^^
      KeyError: 'Windows'
      [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for 1password
    Failed to build 1password
    error: failed-wheel-build-for-install
    
    Failed to build installable wheels for some pyproject.toml based projects
    
    1password

     

  • andyt's avatar
    andyt
    New Contributor

    Realized the 1password SDK did not successfully install for python 3.14. The error when running pip is

    Building wheels for collected packages: 1password
    Building wheel for 1password (pyproject.toml) ... error
    error: subprocess-exited-with-error

    × Building wheel for 1password (pyproject.toml) did not run successfully.
    │ exit code: 1

    ...

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for 1password
    Failed to build 1password
    error: failed-wheel-build-for-install

    × Failed to build installable wheels for some pyproject.toml based projects
    ╰─> 1password

    • Tom's avatar
      Tom
      Bronze Expert

      Tested successfully on a Mac and Linux - so must be something specific. (From a `venv`). What system are you using?

      • andyt's avatar
        andyt
        New Contributor

        Windows 10. Since CLI is not available at this time for W10 I thought I'd use SDK in the meantime.

        If no issues for you then something on my end. Will re-install python 3.14 and try again. Will let you know. 

        Thank you, Andy