AttributeError: can't set attribute on v1.2.0a1 during lock or install
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Debian Linux (slim-buster docker image, python 3.8.2)
- Poetry version: 1.2.0a1
Issue
I am seeing the following issue when a new project is created with the following minimal pyproject.toml
file:
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "example"
version = "0.1.0-alpha.0"
description = "An example"
authors = ["First Last <name@example.com>"]
Running poetry install
or poetry lock
gives the following error:
Skipping virtualenv creation, as specified in config file.
Updating dependencies
Resolving dependencies... (0.0s)
AttributeError
can't set attribute
at /opt/poetry/venv/lib/python3.8/site-packages/poetry/packages/dependency_package.py:38 in __setattr__
34│ def __setattr__(self, key: str, value: Any) -> None:
35│ if key in {"_dependency", "_package"}:
36│ return super().__setattr__(key, value)
37│
→ 38│ setattr(self._package, key, value)
39│
40│ def __str__(self) -> str:
41│ return str(self._package)
Note there are no dependencies in the pyproject.toml
file. In addition to standard install of python, the only other package installed is poetry-dotenv-plugin
and it’s dependencies. Here is a pip list
if needed:
appdirs 1.4.4
CacheControl 0.12.6
cachy 0.3.0
certifi 2021.5.30
cffi 1.14.6
charset-normalizer 2.0.4
cleo 1.0.0a4
crashtest 0.3.1
cryptography 3.4.7
distlib 0.3.2
entrypoints 0.3
filelock 3.0.12
html5lib 1.1
idna 3.2
importlib-metadata 4.6.3
jeepney 0.7.1
keyring 23.0.1
lockfile 0.12.2
msgpack 1.0.2
packaging 20.9
pexpect 4.8.0
pip 21.1.3
pkginfo 1.7.1
poetry 1.2.0a1
poetry-core 1.1.0a6
poetry-dotenv-plugin 0.1.0a2
ptyprocess 0.7.0
pycparser 2.20
pylev 1.4.0
pyparsing 2.4.7
python-dotenv 0.19.0
requests 2.26.0
requests-toolbelt 0.9.1
SecretStorage 3.3.1
setuptools 41.2.0
shellingham 1.4.0
six 1.16.0
tomlkit 0.7.2
urllib3 1.26.6
virtualenv 20.4.4
webencodings 0.5.1
zipp 3.5.0
This issue may be related to issue 4085.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
AttributeError: can't set attribute in python - Stack Overflow
As I tried to overwrite it in my code, it caused AttributeError: can't set attribute . Just simply renaming my variable from self.hparams...
Read more >Python error saying "AttributeError: can't set attribute" - Intellipaat
I'm trying to execute the following python code: class C(object): def __init__(self): ... > c.x = 10 AttributeError: can't set attribute.
Read more >Python error saying \"AttributeError: can\'t set attribute\". How is ...
You have named the setter method as set_x which is off base, this is the reason you are getting the Attribute Error.
Read more >Pypy3.7: AttributeError: Can't set attribute - PyPy - Projects
Pypy3.7: AttributeError: Can't set attribute ... Setup: pip install glooey==0.3.1 ... When running the test script on cpython 3.7.10, ...
Read more >[Solved] AttributeError: can't set attribute in python - Finxter
Specifically, you can change an existing attribute's value and even dynamically add a new attribute to an existing object.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @KCC13 and @paulmelnikow. I tested today with v1.2.0a2 and it fixed the problem. The maintainers can close this issue when they are ready.
indeed this code doesn’t exist any more, should be safe to close