You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, I have started using Poetry for a project in different "services" (on Windows 10 as a local machine).
Installing git dependencies
In my first "service" - just a python package which can be installed in other projects or services - I have created a python package which has the following folder structure:
In my second service, I want to import the my-entities package but it does not seem to work.
I added the my-entities package by executing poetry add my_entities --git https://myprivaterepo.com/my-entities.git
My questions are:
The folder name is my-entities but python does not allow the import of packages with a dash. If I clone the package with poetry add my-entities --git https://myprivaterepo.com/my-entities.git (with a dash in the name) do I need to import the package as my_entities?
If I import my package with import my_entities I get an error ModuleNotFoundError: No module named 'my_entities'. What is the proper way to clone a private git repository where the python code was packaged with poetry and saved into the dist-folder of the repository?
When I execute poetry run pip freeze a message at the top of the packages list appears Could not find setup.py for directory c:\users\user\appdata\local\pypoetry\cache\virtualenvs\my-project-py3.7\src\my-entities\src (tried all parent directories). Why does the error appear? My pip version is pip 19.0.3
Note: I've already looked at #49, #177, #673, #184 and #321 but they did not solve my problem.
Installing path dependencies
Because I work on a Windows machine libraries like Shapely, Fiona, geopandas, and so on can't be installed with pip. Until I switch my OS (or the library owners start to care about Windows users lol) I need to download the wheels from here.
Let's take the wonderful Fiona package as an example. I have downloaded the wheel package and when I execute poetry add Fiona --path E:/User/Downloads/Fiona-1.8.6-cp37-cp37m-win_amd64.whl -vvv I get the following error:
[RuntimeError]
The dependency name for fiona does not match the actual package's name: Fion
a
Exception trace:
C:\Users\User\.poetry\lib\poetry\_vendor\py3.7\cleo\application.py in run() at line 94
status_code = self.do_run(input_, output_)
C:\Users\User\.poetry\lib\poetry\console\application.py in do_run() at line 88
return super(Application, self).do_run(i, o)
C:\Users\User\.poetry\lib\poetry\_vendor\py3.7\cleo\application.py in do_run() at line 197
status_code = command.run(input_, output_)
C:\Users\User\.poetry\lib\poetry\console\commands\command.py in run() at line 77
return super(BaseCommand, self).run(i, o)
C:\Users\User\.poetry\lib\poetry\_vendor\py3.7\cleo\commands\base_command.py in run() at line 146
status_code = self.execute(input_, output_)
C:\Users\User\.poetry\lib\poetry\_vendor\py3.7\cleo\commands\command.py in execute() at line 107
return self.handle()
C:\Users\User\.poetry\lib\poetry\console\commands\add.py in handle() at line 139
status = installer.run()
C:\Users\User\.poetry\lib\poetry\installation\installer.py in run() at line 73
self._do_install(local_repo)
C:\Users\User\.poetry\lib\poetry\installation\installer.py in _do_install() at line 165
ops = solver.solve(use_latest=self._whitelist)
C:\Users\User\.poetry\lib\poetry\puzzle\solver.py in solve() at line 38
packages, depths = self._solve(use_latest=use_latest)
C:\Users\User\.poetry\lib\poetry\puzzle\solver.py in _solve() at line 171
self._package, self._provider, locked=locked, use_latest=use_latest
C:\Users\User\.poetry\lib\poetry\mixology\__init__.py in resolve_version() at line 7
return solver.solve()
C:\Users\User\.poetry\lib\poetry\mixology\version_solver.py in solve() at line 79
next = self._choose_package_version()
C:\Users\User\.poetry\lib\poetry\mixology\version_solver.py in _choose_package_version() at line 354
packages = self._provider.search_for(dependency)
C:\Users\User\.poetry\lib\poetry\puzzle\provider.py in search_for() at line 135
packages = self.search_for_file(dependency)
C:\Users\User\.poetry\lib\poetry\puzzle\provider.py in search_for_file() at line 213
dependency.name, meta.name
I have also tried executing the command poetry add fiona --path E:/User/Downloads/Fiona-1.8.6-cp37-cp37m-win_amd64.whl -vvv with a lowercase f in fiona but I get the same error.
My questions:
4. Is there a way to make poetry use conda instead of pip? Because the package can be installed with conda.
5. How can I ensure in pyproject.toml that Windows users need to download the wheel distributions and other users (Mac, Linux, etc.) can install it the "normal" way with pip? Is there a way to give explicit commands or set flags for different operating systems?
For example something like:
[tool.poetry.dependencies]
Fiona = {version = "^1.8.6", os=["!windows"]}
Fiona = {path = "E:/User/Downloads/Fiona-1.8.6-cp37-cp37m-win_amd64.whl", ifNotExist="Please download the package from https://www.lfd.uci.edu/~gohlke/pythonlibs/#Fiona" os=["windows"]}
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
-vvv
option).pyproject.toml
:Issue
Recently, I have started using Poetry for a project in different "services" (on Windows 10 as a local machine).
Installing git dependencies
In my first "service" - just a python package which can be installed in other projects or services - I have created a python package which has the following folder structure:
The
pyproject.toml
looks like this:In my second service, I want to import the
my-entities
package but it does not seem to work.I added the
my-entities
package by executingpoetry add my_entities --git https://myprivaterepo.com/my-entities.git
My questions are:
my-entities
but python does not allow the import of packages with a dash. If I clone the package withpoetry add my-entities --git https://myprivaterepo.com/my-entities.git
(with a dash in the name) do I need to import the package asmy_entities
?import my_entities
I get an errorModuleNotFoundError: No module named 'my_entities'
. What is the proper way to clone a private git repository where the python code was packaged with poetry and saved into thedist
-folder of the repository?poetry run pip freeze
a message at the top of the packages list appearsCould not find setup.py for directory c:\users\user\appdata\local\pypoetry\cache\virtualenvs\my-project-py3.7\src\my-entities\src (tried all parent directories)
. Why does the error appear? My pip version ispip 19.0.3
Note: I've already looked at #49, #177, #673, #184 and #321 but they did not solve my problem.
Installing path dependencies
Because I work on a Windows machine libraries like Shapely, Fiona, geopandas, and so on can't be installed with pip. Until I switch my OS (or the library owners start to care about Windows users lol) I need to download the wheels from here.
Let's take the wonderful Fiona package as an example. I have downloaded the wheel package and when I execute
poetry add Fiona --path E:/User/Downloads/Fiona-1.8.6-cp37-cp37m-win_amd64.whl -vvv
I get the following error:I have also tried executing the command
poetry add fiona --path E:/User/Downloads/Fiona-1.8.6-cp37-cp37m-win_amd64.whl -vvv
with a lowercasef
infiona
but I get the same error.My questions:
4. Is there a way to make poetry use
conda
instead ofpip
? Because the package can be installed withconda
.5. How can I ensure in
pyproject.toml
that Windows users need to download the wheel distributions and other users (Mac, Linux, etc.) can install it the "normal" way with pip? Is there a way to give explicit commands or set flags for different operating systems?For example something like:
The text was updated successfully, but these errors were encountered: