Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: unsupported operand type(s) for -: 'str' and 'str' (solved) #49

Open
VincentD opened this issue Jun 10, 2022 · 0 comments
Open

Comments

@VincentD
Copy link

I don't know if raising an issue is the good way...
I had a problem that I solved myself! ;-) And I thought it could help other new users.
Maybe it would be useful to add a paragraph in the manual?

I used to import CSV in QGIS by drag-and-drop.
Importing the data layer by this way gives the error message below.

Effectively, the "depthTo" and "depthFrom" fields are imported by default in text format.

To avoid this issue, you need to import the CSV with the "delimited text layer" button.
Then you have to check "Detect field type" and "Use comma as field separator"

And the error goes away.

Good day to all

`Une erreur est survenue lors de l'éxécution du code Python:

TypeError: unsupported operand type(s) for -: 'str' and 'str'
Traceback (most recent call last):
File "/home/vincent/.local/share/QGIS/QGIS3/profiles/default/python/plugins/geoCore/petroProfile_dialog.py", line 157, in showEvent
self.drawProfilesNorthSouth()
File "/home/vincent/.local/share/QGIS/QGIS3/profiles/default/python/plugins/geoCore/petroProfile_dialog.py", line 277, in drawProfilesNorthSouth
self._drawProfiles(crit)
File "/home/vincent/.local/share/QGIS/QGIS3/profiles/default/python/plugins/geoCore/petroProfile_dialog.py", line 303, in _drawProfiles
pac = builder.getProfilesAndConnectors(features)
File "/home/vincent/.local/share/QGIS/QGIS3/profiles/default/python/plugins/geoCore/profileBuilder.py", line 98, in getProfilesAndConnectors
profiles.append(self._getProfile(f.attribute(self.config.settings["boreholeId"]), xp * 100, yp))
File "/home/vincent/.local/share/QGIS/QGIS3/profiles/default/python/plugins/geoCore/profileBuilder.py", line 137, in _getProfile
pb.height = l[self.config.settings["depthTo"]]-l[self.config.settings["depthFrom"]]
TypeError: unsupported operand type(s) for -: 'str' and 'str'

Version de Python : 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
Version de QGIS : 3.22.7-Białowieża Białowieża, 5a65627acb `

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant