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

NameError: name 'os' is not defined #9

Closed
JaviBecerra opened this issue Sep 10, 2018 · 4 comments
Closed

NameError: name 'os' is not defined #9

JaviBecerra opened this issue Sep 10, 2018 · 4 comments
Assignees
Labels

Comments

@JaviBecerra
Copy link
Member

Reported by user @fjb80 (etiennesky#60):

When I try to export as a png, sag or dxf I get the following error:

NameError: name 'os' is not defined

How do I resolve this so I can export the profile?

Thanks,

@JaviBecerra
Copy link
Member Author

We have not been able to reproduce your issue, but we have found a couple of apparently missing 'import os' statements in flowchart.py and plottingtool.py, will upload asap.
Could you provide the full error message (if you open the Python Console you should see the full stacktrace) to check that it is actually one of those two files that is at fault?

@JaviBecerra JaviBecerra self-assigned this Sep 10, 2018
@fjb80
Copy link

fjb80 commented Sep 10, 2018

Here's the full error:

2018-09-10T08:39:39 WARNING Traceback (most recent call last):
File "/Users/USERNAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/profiletool/ui/ptdockwidget.py", line 559, in saveAs
self.outPNG()
File "/Users/USERNAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/profiletool/ui/ptdockwidget.py", line 579, in outPNG
PlottingTool().outPNG(self.iface, self, self.mdl, self.cboLibrary.currentText ())
File "/Users/USERNAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/profiletool/tools/plottingtool.py", line 526, in outPNG
wdg.profiletoolcore.loaddirectory = os.path.dirname(fileName)
NameError: name 'os' is not defined

@JaviBecerra
Copy link
Member Author

Hi @fjb80:
Thanks for the full trace! This should have been fixed with commit 7c98d69, we will be pushing an updated version to qgis repositories tomorrow.
If you want a quick fix before this gets published, you can manually add the line:
import os
to file /Users/USERNAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/profiletool/tools/plottingtool.py right below 'import qgis'

Regards,
Javier

@fjb80
Copy link

fjb80 commented Sep 12, 2018

That did the trick as a quick fix. Thanks!

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

No branches or pull requests

2 participants