{"id":24398,"library":"pysmbclient","title":"PySMBClient","description":"PySMBClient is a convenient wrapper around smbclient for accessing SMB/CIFS shares. Version 0.1.5 is the latest release, but the library appears to be in maintenance mode with infrequent updates.","status":"maintenance","version":"0.1.5","language":"python","source_language":"en","source_url":"https://github.com/ktbartholomew/pysmbclient","tags":["smb","smbclient","wrapper","fileshare"],"install":[{"cmd":"pip install pysmbclient","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"note":"The library is installed as pysmbclient, but the actual module is named smbclient.","wrong":"from pysmbclient import PySMBClient","symbol":"PySMBClient","correct":"from smbclient import PySMBClient"},{"note":"Used for registering authentication credentials.","symbol":"register","correct":"from smbclient import register"},{"note":"Used to reset connections when authentication fails.","symbol":"reset_connections","correct":"from smbclient import reset_connections"}],"quickstart":{"code":"from smbclient import PySMBClient, register\nimport os\n\nregister(username='user', password='pass')\nwith PySMBClient() as client:\n    with client.open('smb://server/share/file.txt', mode='r') as f:\n        print(f.read())","lang":"python","description":"Basic file read from an SMB share. Note: register() must be called before operations."},"warnings":[{"fix":"Use 'from smbclient import PySMBClient' instead of 'from pysmbclient import PySMBClient'.","message":"The library uses the module name 'smbclient', not 'pysmbclient'. Importing 'pysmbclient' directly will raise ModuleNotFoundError.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure your SMB server supports SMB2+; consider using pysmb or smbprotocol for legacy SMB1.","message":"SMB protocol versions older than SMB2 may not be supported. The library relies on system smbclient which may have version restrictions.","severity":"deprecated","affected_versions":">=0.1.4"},{"fix":"Always call register() before instantiating PySMBClient.","message":"Authentication must be registered before any connection. Calling register() after opening a client can cause 'Operation not permitted' errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from smbclient import PySMBClient'","cause":"Trying to import from pysmbclient instead of smbclient.","error":"ModuleNotFoundError: No module named 'pysmbclient'"},{"fix":"Ensure register(username='...', password='...') is called before any SMB operation.","cause":"Invalid credentials or missing register() call.","error":"smbclient failed with: NT_STATUS_LOGON_FAILURE"},{"fix":"Upgrade to pysmbclient>=0.1.3, or use the context manager as shown in quickstart.","cause":"Using an older version where the open method was not yet exposed.","error":"AttributeError: 'PySMBClient' object has no attribute 'open'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}