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

FileNotFoundError: [Errno 2] No such file or directory: '\\venv\\lib\\site-packages\\optimus//css//styles.css' #524

Closed
jralfonsog opened this issue May 8, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@jralfonsog
Copy link

commented May 8, 2019

Hello there.

I've tried to install Optimus in a venv (using PyCharm) by simply writing: pip install optimuspyspark

The first thing I've noticed is that it tried to install pyspark==2.4.3 (last available version), giving a dependency error after that because h2o-pysparkling==2.4.4 needs pyspark==2.4.0.

Because of that, I tried a fresh venv, installing in this order:

  • pyspark==2.4.0
  • h2o-pysparkling==2.4.4
  • optimuspyspark

Sadly, entering:
from optimus import Optimus op = Optimus(master="local")

It gives me:
FileNotFoundError: [Errno 2] No such file or directory: '<env_path>\\lib\\site-packages\\optimus//css//styles.css'

After that, I manually downloaded the file (because the css folder was actually missing), to see the following error:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 36731: character maps to <undefined>

I can't find out if there's something wrong I did, or it has to do with the package itself. Could you please give it a look?

Thanks.

@issue-label-bot

This comment has been minimized.

Copy link

commented May 8, 2019

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.52. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug label May 8, 2019

@argenisleon

This comment has been minimized.

Copy link
Member

commented May 8, 2019

Hi @jralfonsog,

Thanks for the report. We are working in a patch for the first two issues.

About the issue:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 36731: character maps to <undefined>

Can you give us more info? A file or line number?

@jralfonsog

This comment has been minimized.

Copy link
Author

commented May 8, 2019

Sure, my mistake. The whole message is as follows:

Traceback (most recent call last): File "D:\PyProjects\optimus-test\venv\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-3-0bdccaf83159>", line 1, in <module> op = Optimus() File "D:\PyProjects\optimus-test\venv\lib\site-packages\optimus\optimus.py", line 154, in __init__ self._load_css() File "D:\PyProjects\optimus-test\venv\lib\site-packages\optimus\optimus.py", line 171, in _load_css styles = open(url, "r").read() File "C:\Python\Python-3.6.8\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 36731: character maps to <undefined>

Feel free to ask for any additional needed info.

@argenisleon

This comment has been minimized.

Copy link
Member

commented May 8, 2019

Thanks @jralfonsog
It seems that the CSS file has some chars that can be decoded which is weird because is a simple CSS file. Maybe when you download it change the codification. I just add an extra param when open the file to handle utf8.

@FavioVazquez I already make a pull request, and the tests are passed. Can you deploy a new version?

@jralfonsog

This comment has been minimized.

Copy link
Author

commented May 9, 2019

Thanks @argenisleon . I'll let you know.

Meanwhile, v2.2.2 seems to work just fine (I installed pyspark==2.4.0 -> h2o-pysparkling-2.4==2.4.4 -> optimuspyspark==2.2.2)

@argenisleon argenisleon self-assigned this May 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.