Dvc: Unable to add file to DVC - Getting a 'win32timezone' error

Created on 8 Nov 2019  路  10Comments  路  Source: iterative/dvc

DVC version: 0.66.9
Platform: Windows 10 x64
Method of installation: exe

I am busy going through the "Getting Started" section of the website and on the Add Files section I am running the dvc add data/data.xml command to add the data.xml file to DVC.

I get the following error:
ERROR: unexpected error - No module named 'win32timezone'
and the file is not added.

bug p0-critical

All 10 comments

I just observed the same problem.
I had some old versions of dvc installed via scoop and tested with them.
The problem was not present in 0.66.3 and is present in 0.66.6.
I don't have 0.66.4 and 0.66.5 installed and afaik it's not easy to install old versions with scoop.

As a workaround, creating a Python virtual environment and installing dvc via pip allows me add the file as expected. The library which provides the win32timezone module is pywin32.

I managed to install 0.66.5 and the problem is not present there, so it seems to have been introduced between 0.66.5 and 0.66.6.
Here a code comparison between the two versions:
https://github.com/iterative/dvc/compare/ee70822bd434adb36c41e20c63939af69bf0bc64..522579be1ebde78992853a2dc25af3b06893c466

Hi @chris-steenkamp @nightscape ! Thanks for the report! Indeed, looks like it is a bug related to our binary packages (windows exe, mac pkg and linux deb/rpm). A workaround for that is to uninstall dvc and install it from pip, brew or conda. Investigating the issue right now.

@chris-steenkamp @nightscape Btw, guys, could you please share why you've chosen to use our exe installer instead of installing using pip or conda?

@chris-steenkamp @nightscape One more thing, could you run that command with -v added (e.g. dvc add data -v) and share the full log, please?

EDIT: nevermind, I am able to reproduce;

ERROR: unexpected error - No module named 'win32timezone'
------------------------------------------------------------
Traceback (most recent call last):
  File "dvc\main.py", line 50, in main
  File "dvc\command\add.py", line 25, in run
  File "dvc\repo\__init__.py", line 35, in wrapper
  File "dvc\repo\scm_context.py", line 4, in run
  File "dvc\repo\add.py", line 48, in add
  File "dvc\repo\add.py", line 84, in _create_stages
  File "dvc\stage.py", line 484, in create
  File "dvc\stage.py", line 380, in _stage_fname
  File "dvc\utils\fs.py", line 73, in contains_symlink_up_to
  File "dvc\system.py", line 268, in is_symlink
  File "dvc\system.py", line 191, in _getdirinfo
ModuleNotFoundError: No module named 'win32timezone'
----------------------------------

Fix is https://github.com/iterative/dvc/pull/2763 . Also added a simple test to our dvc-test repo(testing existing packages) so we will get that covered in the future. Will release a new version ASAP.

@efiop if that information is still useful: I installed DVC via scoop which uses the .exe file instead of pip or conda.
Thanks for fixing this so quickly!

@chris-steenkamp @nightscape Btw, guys, could you please share why you've chosen to use our exe installer instead of installing using pip or conda?

Thanks for the quick turnaround! The reason I am using the .exe (rather than pip) is because the Installation Docs seem to recommend downloading the installer by default.

@nightscape Oh, I didn't even know about scoop! Looks like @r15ch13 added dvc https://github.com/ScoopInstaller/Main/blob/master/bucket/dvc.json and keeps it up to date! 馃敟

@chris-steenkamp Got it! Thanks for the feedback!

@nightscape @chris-steenkamp A few more questions, if you don't mind 馃檪Are you guys familiar with chocolatey or scoop? Would you prefer to us recommending one of them instead? Are you using standalone python or conda? What if we would recommend one of those?

We don't have anyone that is using windows for development in our team, so we are not sure what would be the preferred method of installation on windows. Coming from *nix, it feels right to use chocolatey or scoop(maybe there is even some other pkg manager that I'm not aware of) to install and manage packages in general, but we are not sure if our typical user is familiar with those 馃檨 As to installing standalone python or conda, those seem like a language bias and we don't recommend those as dvc is language-agnostic and it would be weird(and might be not trivial) to make R developer install python specifically for dvc.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

siddygups picture siddygups  路  3Comments

dmpetrov picture dmpetrov  路  3Comments

TezRomacH picture TezRomacH  路  3Comments

ghost picture ghost  路  3Comments

ghost picture ghost  路  3Comments