Closed devfinwiz closed 9 months ago
clear your cache, update your poetry
(and use triple backticks for formatting)
clear your cache, update your poetry
(and use triple backticks for formatting)
Apologies for no formatting.. I was in a hurry.. poetry self update isn't working as well...
@dimbleby Kindly assist with what can be done...
I did the following:
poetry cache clear --all .
Tried doing poetry add yfinance
again, issue is still the same.
Logs:
Delete 681 entries? (yes/no) [yes] yes
PS C:\Users\Dev.Juneja\Downloads\fin-maestro.py> poetry add yfinance
Using version ^0.2.35 for yfinance
Updating dependencies
Resolving dependencies...
Package operations: 3 installs, 0 updates, 0 removals
• Installing beautifulsoup4 (4.12.2)
• Installing lxml (5.0.1)
FileNotFoundError
[Errno 2] No such file or directory: 'C:\\Users\\Dev.Juneja\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\Local\\pypoetry\\Cache\\virtualenvs\\finmaestro-ZQx55jaC-py3.10\\Lib\\site-packages\\bs4\\tests\\fuzz\\clusterfuzz-testcase-minimized-bs4_fuzzer-4818336571064320.testcase'
at C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\pathlib.py:1119 in open
1115│ the built-in open() function does.
1116│ """
1117│ if "b" not in mode:
1118│ encoding = io.text_encoding(encoding)
→ 1119│ return self._accessor.open(self, mode, buffering, encoding, errors,
1120│ newline)
1121│
1122│ def read_bytes(self):
1123│ """
FileNotFoundError
[Errno 2] No such file or directory: 'C:\\Users\\Dev.Juneja\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\Local\\pypoetry\\Cache\\virtualenvs\\finmaestro-ZQx55jaC-py3.10\\Lib\\site-packages\\lxml\\isoschematron\\resources\\xsl\\iso-schematron-xslt1\\iso_abstract_expand.xsl'
at C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\pathlib.py:1119 in open
1115│ the built-in open() function does.
1116│ """
1117│ if "b" not in mode:
1118│ encoding = io.text_encoding(encoding)
→ 1119│ return self._accessor.open(self, mode, buffering, encoding, errors,
1120│ newline)
1121│
1122│ def read_bytes(self):
1123│ """
PS C:\Users\Dev.Juneja\Downloads\fin-maestro.py>```
Updated poetry with pip.
PS C:\Users\Dev.Juneja\Downloads\fin-maestro.py> pip show poetry
Name: poetry
Version: 1.7.1
Summary: Python dependency management and packaging made easy.
Home-page: https://python-poetry.org/
Author: Sébastien Eustace
Author-email: sebastien@eustace.io
License: MIT
Location: c:\users\dev.juneja\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages
Requires: build, cachecontrol, cleo, crashtest, dulwich, fastjsonschema, installer, keyring, packaging, pexpect, pkginfo, platformdirs, poetry-core, poetry-plugin-export, pyproject-hooks, requests, requests-toolbelt, shellingham, tomli, tomlkit, trove-classifiers, virtualenv
Required-by: poetry-plugin-export
PS C:\Users\Dev.Juneja\Downloads\fin-maestro.py>
-Cleared cache again.
-Tried doing poetry add yfinance
again and faced the same issue.
looks duplicate #8726, in partiular https://github.com/python-poetry/poetry/issues/8726#issuecomment-1831838167
I am now facing the following error when i run poetry shell
@dimbleby :
PS C:\Users\Dev Juneja\Desktop\Fin-Maestro-Kin> poetry shell -vvv
Using virtualenv: C:\Users\Dev Juneja\AppData\Local\pypoetry\Cache\virtualenvs\fin-maestro-kin-toPOwCSZ-py3.11
Spawning shell within C:\Users\Dev Juneja\AppData\Local\pypoetry\Cache\virtualenvs\fin-maestro-kin-toPOwCSZ-py3.11
The argument 'C:\Users\Dev Juneja\AppData\Local\pypoetry\Cache\virtualenvs\fin-maestro-kin-toPOwCSZ-py3.11\Scripts\activate.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.
And this is what happens when I do poetry add yfinance now:
Source (PyPI): No dependencies found, downloading archives
Source (PyPI): Downloading: https://files.pythonhosted.org/packages/6a/30/a727bb1420076b3c14b60911d111f0fc0449d31a1123a1ad18878a7a4e40/peewee-3.17.0.tar.gz
[urllib3.connectionpool] https://files.pythonhosted.org:443 "GET /packages/6a/30/a727bb1420076b3c14b60911d111f0fc0449d31a1123a1ad18878a7a4e40/peewee-3.17.0.tar.gz HTTP/1.1" 200 2947385
[filelock] Attempting to acquire lock 2168959968976 on C:\Users\Dev Juneja\AppData\Local\pypoetry\Cache\cache\repositories\PyPI\_http\3\b\5\2\3\3b52360145ef6bc892452ed6162999032d9b2d422dc54c20b77b4cdb.lock
[filelock] Lock 2168959968976 acquired on C:\Users\Dev Juneja\AppData\Local\pypoetry\Cache\cache\repositories\PyPI\_http\3\b\5\2\3\3b52360145ef6bc892452ed6162999032d9b2d422dc54c20b77b4cdb.lock
[filelock] Attempting to release lock 2168959968976 on C:\Users\Dev Juneja\AppData\Local\pypoetry\Cache\cache\repositories\PyPI\_http\3\b\5\2\3\3b52360145ef6bc892452ed6162999032d9b2d422dc54c20b77b4cdb.lock
[filelock] Lock 2168959968976 released on C:\Users\Dev Juneja\AppData\Local\pypoetry\Cache\cache\repositories\PyPI\_http\3\b\5\2\3\3b52360145ef6bc892452ed6162999032d9b2d422dc54c20b77b4cdb.lock
1: Version solving took 8.114 seconds.
1: Tried 1 solutions.
Stack trace:
4 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\puzzle\solver.py:155 in _solve
153│
154│ try:
→ 155│ result = resolve_version(self._package, self._provider)
156│
157│ packages = result.packages
3 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\mixology\__init__.py:18 in resolve_version
16│ solver = VersionSolver(root, provider)
17│
→ 18│ return solver.solve()
19│
2 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\mixology\version_solver.py:164 in solve
162│ while next is not None:
163│ self._propagate(next)
→ 164│ next = self._choose_package_version()
165│
166│ return self._result()
1 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\mixology\version_solver.py:503 in _choose_package_version
501│ package = locked
502│
→ 503│ package = self._provider.complete_package(package)
504│
505│ conflict = False
OverrideNeeded
({Package('pandas', '2.1.4'): {'numpy': <Dependency numpy (>=1.22.4,<2)>}}, {Package('pandas', '2.1.4'): {'numpy': <Dependency numpy (>=1.23.2,<2)>}}, {Package('pandas', '2.1.4'): {'numpy': <Dependency numpy (>=1.26.0,<2)>}})
at ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\puzzle\provider.py:660 in complete_package
656│ current_overrides.update({dependency_package: package_overrides})
657│ overrides.append(current_overrides)
658│
659│ if overrides:
→ 660│ raise OverrideNeeded(*overrides)
661│
662│ # Modifying dependencies as needed
663│ clean_dependencies = []
664│ for dep in dependencies:
The following error occurred when trying to handle this error:
Stack trace:
36 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\cleo\application.py:327 in run
325│
326│ try:
→ 327│ exit_code = self._run(io)
328│ except BrokenPipeError:
329│ # If we are piped to another process, it may close early and send a
35 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\console\application.py:190 in _run
188│ self._load_plugins(io)
189│
→ 190│ exit_code: int = super()._run(io)
191│ return exit_code
192│
34 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\cleo\application.py:431 in _run
429│ io.input.interactive(interactive)
430│
→ 431│ exit_code = self._run_command(command, io)
432│ self._running_command = None
433│
33 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\cleo\application.py:473 in _run_command
471│
472│ if error is not None:
→ 473│ raise error
474│
475│ return terminate_event.exit_code
32 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\cleo\application.py:457 in _run_command
455│
456│ if command_event.command_should_run():
→ 457│ exit_code = command.run(io)
458│ else:
459│ exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED
31 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\cleo\commands\base_command.py:117 in run
115│ io.input.validate()
116│
→ 117│ return self.execute(io) or 0
118│
119│ def merge_application_definition(self, merge_args: bool = True) -> None:
30 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\cleo\commands\command.py:61 in execute
59│
60│ try:
→ 61│ return self.handle()
62│ except KeyboardInterrupt:
63│ return 1
29 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\console\commands\add.py:267 in handle
265│ self.installer.whitelist([r["name"] for r in requirements])
266│
→ 267│ status = self.installer.run()
268│
269│ if status == 0 and not self.option("dry-run"):
28 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\installation\installer.py:104 in run
102│ self.verbose(True)
103│
→ 104│ return self._do_install()
105│
106│ def dry_run(self, dry_run: bool = True) -> Installer:
27 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\installation\installer.py:241 in _do_install
239│ source_root=self._env.path.joinpath("src")
240│ ):
→ 241│ ops = solver.solve(use_latest=self._whitelist).calculate_operations()
242│ else:
243│ self._io.write_line("Installing dependencies from lock file")
26 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\puzzle\solver.py:72 in solve
70│ with self._progress(), self._provider.use_latest_for(use_latest or []):
71│ start = time.time()
→ 72│ packages, depths = self._solve()
73│ end = time.time()
74│
25 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\puzzle\solver.py:159 in _solve
157│ packages = result.packages
158│ except OverrideNeeded as e:
→ 159│ return self._solve_in_compatibility_mode(e.overrides)
160│ except SolveFailure as e:
161│ raise SolverProblemError(e)
24 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\puzzle\solver.py:133 in _solve_in_compatibility_mode
131│ )
132│ self._provider.set_overrides(override)
→ 133│ _packages, _depths = self._solve()
134│ for index, package in enumerate(_packages):
135│ if package not in packages:
23 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\puzzle\solver.py:155 in _solve
153│
154│ try:
→ 155│ result = resolve_version(self._package, self._provider)
156│
157│ packages = result.packages
22 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\mixology\__init__.py:18 in resolve_version
16│ solver = VersionSolver(root, provider)
17│
→ 18│ return solver.solve()
19│
21 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\mixology\version_solver.py:164 in solve
162│ while next is not None:
163│ self._propagate(next)
→ 164│ next = self._choose_package_version()
165│
166│ return self._result()
20 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\mixology\version_solver.py:503 in _choose_package_version
501│ package = locked
502│
→ 503│ package = self._provider.complete_package(package)
504│
505│ conflict = False
19 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\puzzle\provider.py:492 in complete_package
490│ dependency_package = DependencyPackage(
491│ dependency,
→ 492│ self._pool.package(
493│ package.pretty_name,
494│ package.version,
18 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\repositories\repository_pool.py:204 in package
202│ for repo in self.repositories:
203│ try:
→ 204│ return repo.package(name, version, extras=extras)
205│ except PackageNotFound:
206│ continue
17 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\repositories\cached_repository.py:75 in package
73│ extras: list[str] | None = None,
74│ ) -> Package:
→ 75│ return self.get_release_info(canonicalize_name(name), version).to_package(
76│ name=name, extras=extras
77│ )
16 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\repositories\cached_repository.py:52 in get_release_info
50│ return PackageInfo.load(self._get_release_info(name, version))
51│
→ 52│ cached = self._release_cache.remember(
53│ f"{name}:{version}", lambda: self._get_release_info(name, version)
54│ )
15 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\utils\cache.py:146 in remember
144│ value = self.get(key)
145│ if value is None:
→ 146│ value = callback() if callable(callback) else callback
147│ self.put(key, value, minutes)
148│ return value
14 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\repositories\cached_repository.py:53 in <lambda>
51│
52│ cached = self._release_cache.remember(
→ 53│ f"{name}:{version}", lambda: self._get_release_info(name, version)
54│ )
55│
13 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\repositories\pypi_repository.py:184 in _get_release_info
182│ return data.asdict()
183│
→ 184│ info = self._get_info_from_urls(urls)
185│
186│ data.requires_dist = info.requires_dist
12 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\repositories\http_repository.py:204 in _get_info_from_urls
202│ return self._get_info_from_wheel(first_wheel)
203│
→ 204│ return self._get_info_from_sdist(urls["sdist"][0])
205│
206│ def _links_to_data(self, links: list[Link], data: PackageInfo) -> dict[str, Any]:
11 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\repositories\http_repository.py:98 in _get_info_from_sdist
96│
97│ with self._cached_or_downloaded_file(Link(url)) as filepath:
→ 98│ return PackageInfo.from_sdist(filepath)
99│
100│ def _get_info_from_urls(self, urls: dict[str, list[str]]) -> PackageInfo:
10 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\inspection\info.py:507 in from_sdist
505│ """
506│ if path.is_file():
→ 507│ return cls._from_sdist_file(path=path)
508│
509│ # if we get here then it is neither an sdist instance nor a file
9 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\inspection\info.py:315 in _from_sdist_file
313│
314│ # now this is an unpacked directory we know how to deal with
→ 315│ new_info = cls.from_directory(path=sdist_dir)
316│
317│ if not info:
8 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\inspection\info.py:487 in from_directory
485│ info = cls.from_setup_files(path)
486│ else:
→ 487│ info = get_pep517_metadata(path)
488│ except PackageInfoError:
489│ if not info:
7 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\inspection\info.py:570 in get_pep517_metadata
568│ return info
569│
→ 570│ with ephemeral_environment(
571│ flags={"no-pip": False, "setuptools": "bundle", "wheel": "bundle"}
572│ ) as venv:
6 ~\AppData\Local\Programs\Python\Python311\Lib\contextlib.py:137 in __enter__
135│ del self.args, self.kwds, self.func
136│ try:
→ 137│ return next(self.gen)
138│ except StopIteration:
139│ raise RuntimeError("generator didn't yield") from None
5 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\utils\env\__init__.py:49 in ephemeral_environment
47│ # TODO: cache PEP 517 build environment corresponding to each project venv
48│ venv_dir = Path(tmp_dir) / ".venv"
→ 49│ EnvManager.build_venv(
50│ path=venv_dir,
51│ executable=executable,
4 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\poetry\utils\env\env_manager.py:671 in build_venv
669│ args.append(str(path))
670│
→ 671│ cli_result = virtualenv.cli_run(args)
672│
673│ # Exclude the venv folder from from macOS Time Machine backups
3 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\virtualenv\run\__init__.py:33 in cli_run
31│ of_session = session_via_cli(args, options, setup_logging, env)
32│ with of_session:
→ 33│ of_session.run()
34│ return of_session
35│
2 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\virtualenv\run\session.py:45 in run
43│ def run(self):
44│ self._create()
→ 45│ self._seed()
46│ self._activate()
47│ self.creator.pyenv_cfg.write()
1 ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\virtualenv\run\session.py:58 in _seed
56│ if self.seeder is not None and self.seeder.enabled:
57│ logging.info("add seed packages via %s", self.seeder)
→ 58│ self.seeder.run(self.creator)
59│
60│ def _activate(self):
RuntimeError
failed to build image pip because:
Traceback (most recent call last):
File "C:\Users\Dev Juneja\AppData\Local\Programs\Python\Python311\Lib\site-packages\virtualenv\seed\embed\via_app_data\via_app_data.py", line 57, in _install
installer.install(creator.interpreter.version_info)
File "C:\Users\Dev Juneja\AppData\Local\Programs\Python\Python311\Lib\site-packages\virtualenv\seed\embed\via_app_data\pip_install\base.py", line 33, in install
self._uninstall_previous_version()
File "C:\Users\Dev Juneja\AppData\Local\Programs\Python\Python311\Lib\site-packages\virtualenv\seed\embed\via_app_data\pip_install\base.py", line 144, in _uninstall_previous_version
dist_name = self._dist_info.stem.split("-")[0]
^^^^^^^^^^^^^^^
File "C:\Users\Dev Juneja\AppData\Local\Programs\Python\Python311\Lib\site-packages\virtualenv\seed\embed\via_app_data\pip_install\base.py", line 110, in _dist_info
raise RuntimeError(msg) # pragma: no cover
^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: no .dist-info at C:\Users\Dev Juneja\AppData\Local\pypa\virtualenv\wheel\3.11\image\1\CopyPipInstall\pip-23.3.1-py3-none-any, has pip
at ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\virtualenv\seed\embed\via_app_data\via_app_data.py:71 in run
67│ messages = [f"failed to build image {', '.join(exceptions.keys())} because:"]
68│ for value in exceptions.values():
69│ exc_type, exc_value, exc_traceback = value
70│ messages.append("".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))
→ 71│ raise RuntimeError("\n".join(messages))
72│
73│ @contextmanager
74│ def _get_seed_wheels(self, creator): # noqa: C901
75│ name_to_whl, lock, fail = {}, Lock(), {}
I tried clearing cache multiple times and then reattempted poetry add but no luck. Kindly assist @dimbleby !
Closing the issue. The permission error was clarified with the reference comment. The new issue that I was facing was due to Python 3.11. Switched to 3.9 and all's good now.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
NOTE: This issue occurs only for some packages idk why. One of them is yfinance. Please help me get unblocked on this.
Logs: -
--pyproject.toml:
-vvv
option) and have included the output below.--Execution logs with debug mode: