Import plotly_express error: source code string cannot contain null bytes

I am trying to import plotly express unsuccessfully for several days. I already reinstalled but the problem continues. Iā€™m with Python 3.7.3 installed by Anaconda and using Jupyter Notebook on Windows 10.

For installation I used pip install plotly_express.

The error message is ValueError: source code string cannot contain null bytes. Other newly installed libraries like pandas profiling are fine.

Log:

import plotly_express as px

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-5-eb81fef41697> in <module>
----> 1 import plotly_express as pxx

~\AppData\Local\Continuum\anaconda3\lib\site-packages\plotly_express\__init__.py in <module>
      5 __version__ = "0.4.1"  # sync with setup.py!
      6 
----> 7 from plotly.express import *

~\AppData\Local\Continuum\anaconda3\lib\site-packages\plotly\__init__.py in <module>
     28 from __future__ import absolute_import
     29 
---> 30 from plotly import (
     31     graph_objs,
     32     tools,

~\AppData\Local\Continuum\anaconda3\lib\site-packages\plotly\io\__init__.py in <module>
----> 1 from ._orca import to_image, write_image
      2 from . import orca
      3 
      4 from ._json import to_json, from_json, read_json, write_json
      5 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\plotly\io\_orca.py in <module>
     12 from contextlib import contextmanager
     13 
---> 14 import retrying
     15 from six import string_types
     16 

ValueError: source code string cannot contain null bytes

Installation log:

PS C:\Users\m2102884720\Documents> pip install plotly_express
Collecting plotly_express
  Using cached https://files.pythonhosted.org/packages/d4/d6/8a2906f51e073a4be80cab35cfa10e7a34853e60f3ed5304ac470852a08d/p
lotly_express-0.4.1-py2.py3-none-any.whl
Requirement already satisfied: patsy>=0.5 in c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages (from
 plotly_express) (0.5.1)
Requirement already satisfied: statsmodels>=0.9.0 in c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packag
es (from plotly_express) (0.10.0)
Requirement already satisfied: numpy>=1.11 in c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages (fro
m plotly_express) (1.16.4)
Requirement already satisfied: pandas>=0.20.0 in c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages (
from plotly_express) (0.24.2)
Collecting plotly>=4.1.0 (from plotly_express)
  Downloading https://files.pythonhosted.org/packages/f7/05/3c32c6bc85acbd30a18fbc3ba732fed5e48e5f8fd60d2a148877970f4a61/pl
otly-4.2.1-py2.py3-none-any.whl (7.2MB)
     |ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ| 7.2MB 2.2MB/s
Requirement already satisfied: scipy>=0.18 in c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages (fro
m plotly_express) (1.2.1)
Requirement already satisfied: six in c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages (from patsy>
=0.5->plotly_express) (1.12.0)
Requirement already satisfied: python-dateutil>=2.5.0 in c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-pa
ckages (from pandas>=0.20.0->plotly_express) (2.8.0)
Requirement already satisfied: pytz>=2011k in c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages (fro
m pandas>=0.20.0->plotly_express) (2019.1)
Requirement already satisfied: retrying>=1.3.3 in c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages
(from plotly>=4.1.0->plotly_express) (1.3.3)
Installing collected packages: plotly, plotly-express
Successfully installed plotly-4.2.1 plotly-express-0.4.1

Hi, plotly express is now (plotly >= 4.0) part of the potly module, plotly_express is a legacy module. You can import is as

import plotly.express as px

:slightly_frowning_face:

the error persists

import plotly.express as px
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-86e89bd44552> in <module>
----> 1 import plotly.express as px

~\AppData\Local\Continuum\anaconda3\lib\site-packages\plotly\__init__.py in <module>
     28 from __future__ import absolute_import
     29 
---> 30 from plotly import (
     31     graph_objs,
     32     tools,

~\AppData\Local\Continuum\anaconda3\lib\site-packages\plotly\io\__init__.py in <module>
----> 1 from ._orca import to_image, write_image
      2 from . import orca
      3 
      4 from ._json import to_json, from_json, read_json, write_json
      5 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\plotly\io\_orca.py in <module>
     12 from contextlib import contextmanager
     13 
---> 14 import retrying
     15 from six import string_types
     16 

ValueError: source code string cannot contain null bytes

I uninstalled by pip and reinstalled by conda. It worked! This was my log.

PS C:\Users\m2102884720\Documents> pip uninstall plotly
Uninstalling plotly-4.1.0:
  Would remove:
    c:\users\m2102884720\appdata\local\continuum\anaconda3\etc\jupyter\nbconfig\notebook.d\plotlywidget.json
    c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages\_plotly_future_\*
    c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages\_plotly_utils\*
    c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages\plotly-4.1.0.dist-info\*
    c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages\plotly\*
    c:\users\m2102884720\appdata\local\continuum\anaconda3\lib\site-packages\plotlywidget\*
    c:\users\m2102884720\appdata\local\continuum\anaconda3\share\jupyter\nbextensions\plotlywidget\extension.js
    c:\users\m2102884720\appdata\local\continuum\anaconda3\share\jupyter\nbextensions\plotlywidget\index.js
Proceed (y/n)? y
  Successfully uninstalled plotly-4.1.0



PS C:\Users\m2102884720\Documents> conda install plotly


Collecting package metadata (current_repodata.json): done
Solving environment: -
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - defaults/win-64::anaconda==custom=py37_1
  - defaults/win-64::numba==0.45.1=py37hf9181ef_0
  - defaults/win-64::_anaconda_depends==2019.03=py37_0                                                                   do
ne

## Package Plan ##

  environment location: C:\Users\m2102884720\AppData\Local\Continuum\anaconda3

  added / updated specs:
    - plotly


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    plotly-4.1.1               |             py_0         4.0 MB
    retrying-1.3.3             |           py37_2          16 KB
    tbb-2019.4                 |       h74a9793_0         156 KB
    ------------------------------------------------------------
                                           Total:         4.2 MB

The following NEW packages will be INSTALLED:

  plotly             pkgs/main/noarch::plotly-4.1.1-py_0
  retrying           pkgs/main/win-64::retrying-1.3.3-py37_2
  tbb                pkgs/main/win-64::tbb-2019.4-h74a9793_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
tbb-2019.4           | 156 KB    | ############################################################################### | 100%
plotly-4.1.1         | 4.0 MB    | ############################################################################### | 100%
retrying-1.3.3       | 16 KB     | ############################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
PS C:\Users\m2102884720\Documents>