AttributeError: 'module' object has no attribute 'GridFS' - python

import pymongo
import gridfs
conn=pymongo.Connection()
db=conn.gridfs_testing
fs=gridfs.GridFS(db)
fs.list()
fs.put(open('/home/sairam_siripuram/Desktop/nba_data/01 - Intro.mp4','r'),filename='01 - Intro')
In the above code im trying to store mp4 file into mongodb using gridfs but it is throwing me the below error
Import Error:
Error:
fs=gridfs.GridFS(db)
AttributeError: 'module' object has no attribute 'GridFS'
[Finished in 0.1s with exit code 1]

Related

problem with from google.api import http_pb2 as google_dot_api_dot_http__pb2

I'am trying to import pinecone but I get the following error :
AttributeError: 'NoneType' object has no attribute 'message_types_by_name'
which is related to :
from google.api import http_pb2 as google_dot_api_dot_http__pb2.
what i've try :
upgrade protobuf LR
downgrade protobuf==3.13
downgrade grpcio==1.30.0
Result of from google.protobuf.internal import api_implementation is: python
Cheers

AttributeError: module 'transposer' has no attribute 'transpose'

I am running a script which needed transposer, I import that module, but it got this error:
....line 184, in jj=transposer.transpose(i=args.v+ '/vcf_to_str/'+args.o+"TransposedStruct.str",d="\t",)
AttributeError: module 'transposer' has no attribute 'transpose'
Would you please help me to solve that? Thanks

TypeError: 'module' object is not callable ----

My code has the following relevant line:
import collections as Counter
It outputs the following:
TypeError
<ipython-input-13-8b716be54873> in <module>
----> 1 print(sorted(Counter(dataset['Best']).items()))
TypeError: 'module' object is not callable
Why is this happening, and how can I fix it?
I think you meant from collections import Counter.

AttributeError: module 'tfx_bsl.arrow.array_util' has no attribute 'ValueCounts'

I am trying to import a csv dataset using this:
full_data_stats = tfdv.generate_statistics_from_csv(data_location='PATH.csv')
It's giving me
AttributeError: module 'tfx_bsl.arrow.array_util' has no attribute 'ValueCounts' [while running 'GenerateStatistics/RunStatsGenerators/GenerateSlicedStatisticsImpl/TopKUniquesStatsGenerator/ToTopKTuples']

AttributeError: 'module' object has no attribute 'ver'

import pygame
print pygame.ver
throws the following exception
AttributeError: 'module' object has no attribute 'ver'
I don't know how to fix it. I should have pygame installed but it still shows this exception.
The attribute is pygame.version.ver, so you need to use:
import pygame
print(pygame.version.ver)

Categories

Resources