Skip to content

TypeError: argument of type 'WindowsPath' is not iterable #32

@yudhanjaya

Description

@yudhanjaya

I seem to be having an issue loading the bitsandbytes library in Windows (works on Collab without issue). EDIT: not sure if bitsandbytes alone or something else: apologies if this is unrelated.

Error message:

Traceback (most recent call last):
  File "C:\Users\User\text-gen\alt2.py", line 4, in <module>
    import bitsandbytes
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\__init__.py", line 6, in <module>
    from .autograd._functions import (
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\autograd\_functions.py", line 4, in <module>
    import bitsandbytes.functional as F
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\functional.py", line 14, in <module>
    from .cextension import COMPILED_WITH_CUDA, lib
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\cextension.py", line 41, in <module>
    lib = CUDALibrary_Singleton.get_instance().lib
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\cextension.py", line 37, in get_instance
    cls._instance.initialize()
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\cextension.py", line 31, in initialize
    self.lib = ct.cdll.LoadLibrary(binary_path)
  File "E:\Anaconda\lib\ctypes\__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
  File "E:\Anaconda\lib\ctypes\__init__.py", line 364, in __init__
    if '/' in name or '\\' in name:
TypeError: argument of type 'WindowsPath' is not iterable

A search around the issue gave me this: https://bugs.python.org/issue39243
The code that I'm trying to run is essentially trying to get the hivemind gpt-j 8-bit model running on my 1080ti (again, works in Collab).


UPDATE: 
Same issue even with a fresh install and simply attempting to loading the library

(base) C:\Users\User\text-gen>pip install git+https://github.com/TimDettmers/bitsandbytes
Collecting git+https://github.com/TimDettmers/bitsandbytes
Cloning https://github.com/TimDettmers/bitsandbytes to c:\users\user\appdata\local\temp\pip-req-build-vh0wtmvn
Running command git clone --filter=blob:none --quiet https://github.com/TimDettmers/bitsandbytes 'C:\Users\User\AppData\Local\Temp\pip-req-build-vh0wtmvn'
Resolved https://github.com/TimDettmers/bitsandbytes to commit f0ae860
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done

(base) C:\Users\User\text-gen>python
Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.

import bitsandbytes

===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues
For effortless bug reporting copy-paste your error into this form: https://docs.google.com/forms/d/e/1FAIpQLScPB8emS3Thkp66nvqwmjTEgxp8Y9ufuWTzFyr9kJ5AoI47dQ/viewform?usp=sf_link

WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('E')}
E:\Anaconda\lib\site-packages\bitsandbytes\cuda_setup\paths.py:98: UserWarning: E:\Anaconda did not contain libcudart.so as expected! Searching further paths...
warn(
WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('/SteamLibrary/steamapps/common/Besiege/Besiege_Data/Managed'), WindowsPath('F')}
WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('/SteamLibrary/steamapps/common/Besiege/Besiege_Data/Managed'), WindowsPath('F')}
CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64...
WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('/usr/local/cuda/lib64')}
WARNING: No libcudart.so found! Install CUDA or the cudatoolkit package (anaconda)!
CUDA SETUP: Loading binary E:\Anaconda\lib\site-packages\bitsandbytes\libbitsandbytes_cpu.so...
Traceback (most recent call last):
File "", line 1, in
File "E:\Anaconda\lib\site-packages\bitsandbytes_init_.py", line 6, in
from .autograd._functions import (
File "E:\Anaconda\lib\site-packages\bitsandbytes\autograd_functions.py", line 4, in
import bitsandbytes.functional as F
File "E:\Anaconda\lib\site-packages\bitsandbytes\functional.py", line 14, in
from .cextension import COMPILED_WITH_CUDA, lib
File "E:\Anaconda\lib\site-packages\bitsandbytes\cextension.py", line 41, in
lib = CUDALibrary_Singleton.get_instance().lib
File "E:\Anaconda\lib\site-packages\bitsandbytes\cextension.py", line 37, in get_instance
cls.instance.initialize()
File "E:\Anaconda\lib\site-packages\bitsandbytes\cextension.py", line 31, in initialize
self.lib = ct.cdll.LoadLibrary(binary_path)
File "E:\Anaconda\lib\ctypes_init
.py", line 460, in LoadLibrary
return self.dlltype(name)
File "E:\Anaconda\lib\ctypes_init
.py", line 364, in init
if '/' in name or '\' in name:
TypeError: argument of type 'WindowsPath' is not iterable

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationImprovements or additions to documentationEnhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions